Q:

Write a script that will load data from a file into a matrix. Create the data file first, and make sure that there is the same number of values on every line in the file so that it can be loaded into a matrix

0

 Write a script that will load data from a file into a matrix. Create the

data file first, and make sure that there is the same number of values 

on every line in the file so that it can be loaded into a matrix. Using a 

for loop, it will then create a subplot for every row in the matrix, and 

will plot the numbers from each row element in the Figure Window. 

xfile.dat

4 9 22

30 18 4

All Answers

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

Ch5Ex8.m

% load data from a file and plot data

% from each line in a separate plot in a subplot

load xfile.dat

[r c] = size(xfile);

for i = 1:r

 subplot(1,r,i)

 plot(xfile(i,:),'k*')

end

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