How can I add a set of 500 datas to workspace and plot them?
1 view (last 30 days)
Show older comments
I have never used matlab. I have a set of 500 .ascii extensioned files. I open them in current folder. I click one of them and while holding it, I carry it to the workspace window. (this bring import wizard screen-I click next) I right click on the yellow colored ascii data on the workplace and plot it. then I need to save each of these plotted image in jpeg fomat. this needs to be done for each 500 items, I guess I need a script for this. but I dont know how to do it. Can someone help me please ?
0 Comments
Accepted Answer
dpb
on 21 Aug 2014
Start with the FAQ at
I strongly recommend using the dir solution to process the files returned.
Something like the following should be a rough starting point...
d=dir('*.ascii'); % the directory list of files--salt wildcard/extension to suit
for i=1:length(d)
data=textread(d.name(i)); % read a file
plot(data(:,1),data(:,2)); % plot 2nd column vs first
[~,name]=fileparts(d.name(i)); % get the root name of the file
print -djpeg name % write to name[.jpg]
close 1 % close that figure
end
More Answers (0)
See Also
Categories
Find more on Visual Exploration in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!