Q:

Create a file called “testtan.dat” comprised of two lines with three real numbers on each line (some negative, some positive, in the -1 to 3 range). The file can be created from the Editor, or saved from a matrix

0

 Create a file called “testtan.dat” comprised of two lines with three real numbers on each line (some negative, some positive, in the -1 to 3 range). The file can be created from the Editor, or saved from a matrix. Then, load the file into a matrix and calculate the tangent of every element in the resulting matrix. 

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

>> mat = rand(2,3)*4-1

mat =

 1.8242 0.1077 -0.6115

 -0.8727 -0.8153 2.2938

>> save testtan.dat mat -ascii

>> load testtan.dat

>> tan(testtan)

ans =

 -3.8617 0.1081 -0.7011

 -1.1918 -1.0617 -1.1332

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now