Hello, i am trying to export a plot into a jpeg file but i always get the following error message: Undefined function or variable 'a'.
The code is the following:
t=0:0.01:(3*pi)/2;
x =sin(1.8*pi*t);
plot(t,x,'r-.');
imwrite(a,'a1.jpg');
i also got the same error while trying to use saveas command instead. Does anyone know what am i doing wrong?

 採用された回答

madhan ravi
madhan ravi 2018 年 12 月 18 日
編集済み: madhan ravi 2018 年 12 月 18 日

0 投票

t=0:0.01:(3*pi)/2;
x =sin(1.8.*pi.*t);
plot(t,x,'r-.');
saveas(gcf,'example.jpg') % not imwrite

1 件のコメント

Spiros Arkoudelis
Spiros Arkoudelis 2018 年 12 月 18 日
Thank you very much!

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeImages についてさらに検索

製品

リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by