Not able to write the image by reading xcel files generated , getting error of data type as shown in picture attached. Anybody please help.
1 次查看(过去 30 天)
显示 更早的评论
回答(5 个)
Walter Roberson
2022-1-5
You cannot do that. The result of imagesc is an OOP object, and OOP objects cannot be written to excel files.
Perhaps for your purposes it would be good enough to change
z = imagesc(n);
to
z = rescale(n);
0 个评论
Constantino Carlos Reyes-Aldasoro
2022-1-4
This is not very clear, it would be better to copy the code instead of figures and provide a sample file so that the case can be reproduced. However, there is a clear error in the following:
z=imagesc(n);
imwrite(z...)
When you do z=imagesc(n) you are using z as a handle to the image that will be generated with imagesc, for instance:
n=randn(65);
z=imagesc(n);
get(z)
Clearly that is not what you want to save as an excel file.
3 个评论
Constantino Carlos Reyes-Aldasoro
2022-1-5
Back to the same point z is a handle to the image, but if you want to output that as a file (say a png) you do not use imwrite like that, try this
n=randn(65);
z=imagesc(n);
imwrite(n,'testfile.png')
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!