MATLAB isn't working to generate figures

5 ビュー (過去 30 日間)
hufsa tahseen
hufsa tahseen 2021 年 1 月 19 日
編集済み: Daniel Pollard 2021 年 1 月 19 日
my matlab is not generating any output like its not giving the figure when i write i amshow command or performaning any commands given below ...please help its argent

回答 (1 件)

Daniel Pollard
Daniel Pollard 2021 年 1 月 19 日
Use hold on and hold off when generating figures. I've not used imshow before, but I'll guess that each time you generate a figure it overwrites the old one. The hold commands stop that.
While I'm here:
Also, I can't test if my suggestion helps you, because I can't run a screenshot of your code. Copy and paste your code, format it correctly and attach any files you use and someone will be 100x more likely to be able to help.
  5 件のコメント
hufsa tahseen
hufsa tahseen 2021 年 1 月 19 日
can you please guide me how can i use hold commands i have no idea about it
Daniel Pollard
Daniel Pollard 2021 年 1 月 19 日
編集済み: Daniel Pollard 2021 年 1 月 19 日
When you create a figure, you can tell Matlab to keep working on that environment until you say otherwise. This is particularly useful if you want to plot multiple things on the same axis, or generate multiple plots without overwriting any others. For example, for your code, I would write
figure; hold on
imshow(A);
title('original')
hold off
C=C*17;
figure; hold on
imshow(uint8(C));
hold off
D=D*85;
figure; hold on
imshow(uint8(D));
title('2-bit');
hold off
E=E*255;
figure; hold on
imshow(uint8));
title('1bit');
hold off
Let me know if that works.
Edit In the future, it's very helpful to use the matlab documention if you're unsure. Googling matlab hold returns the documentation as the first result, or you can type help hold or doc hold into your Matlab command window (even without an internet connection) to see the documentation.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by