How to input string in a Matlab function -
i want write function loads text file , plots content time. have 20 text files want able choose them.
my current not working code:
textfile generic variable text123.txt actual name of 1 of files want load
function []= plottext(textfile) text(1,:)=load('text123.txt') ; t=0:10; plot(t,text) end
i appreciate help!!
use importdata instead of load appropriate delimiter. assume used tab.
filename = 'num.txt'; delimiterin = '\t'; text = importdata(filename,delimiterin) t=1:10; plot(t,text);
Comments
Post a Comment