Construct image from given file
信息
此问题已关闭。 请重新打开它进行编辑或回答。
显示 更早的评论
these are the codes of my script to open the attached file
f= fopen('d20160413.txt');
c = textscan(f,'%s','delimiter','\n');
fclose(f)
c = c{:};
[~,~,~,v] = regexp(c,'\d*\.\d+E[\-\+]\d{2}')
out = reshape(str2double([v{:}]),27,[]);
however, i cannot construct the image from the code. I have used imshow(out) to get the image but it doesnt work.
5 个评论
Geoff Hayes
2016-10-13
Nada - what should the image be? Given your code and the attached text file, the image data seems to be taken from the second column for each scan (of which there are 27). These values are small - with the minimum of out being 0.0676 and the maximum being 1.9912. Is this what you expect? Do you need to provide a map to assign colours to ranges of numbers?
Nada Zamri
2016-10-13
编辑:Nada Zamri
2016-10-13
Image Analyst
2016-10-13
So you read your data in and made a 27x27 image/matrix. But you say that's too small. Exactly how big do you think your "original data" should be, and if it's not 27x27, then how and why did you create a 27x27 matrix from it?
Nada Zamri
2016-10-13
编辑:Nada Zamri
2016-10-13
Walter Roberson
2016-10-13
27 x 27 is all that is in that file. You can imshow() it with an InitialMagnification to show in a larger window, but there just isn't more data there.
回答(0 个)
此问题已关闭。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!