how to comment a mathmatical expression

4 ビュー (過去 30 日間)
rahul
rahul 2014 年 8 月 19 日
回答済み: Image Analyst 2014 年 8 月 20 日
i m attaching display_mat.zip file in which i want to comment the follwing 'cut value must be between ((length(x)-1)/sr1) 'and' ((length(x)-1)/sr1)' but expression ((length(x)-1)/sr1) must give display equivalent numerical value. i mean display shoul be for example 'cut value must be between -4 and 4' how can i get it. sir last time i forgot to mention that i want to display all that on a error dialog box. pls now sol. you can also intimate me on rahulsharma@bel.co.in
pls help asap regards Rahul sharma

回答 (2 件)

Michael Haderlein
Michael Haderlein 2014 年 8 月 19 日
I didn't download your file, but if you want to display something like
'cut value must be between -4 and 4'
you can simply use fprintf:
sr1=1;x=rand(1,5);
fprintf(1,'cut value must be between -%d and %d\n',(length(x)-1)/sr1,(length(x)-1)/sr1)
  1 件のコメント
rahul
rahul 2014 年 8 月 20 日
sir last time i forgot to mention that i want to display all that on a error dialog box. pls now sol.

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


Image Analyst
Image Analyst 2014 年 8 月 20 日
message = sprintf('the cut value must be between -%d and %d',(length(x)-1)/sr1,(length(x)-1)/sr1);
uiwait(warndlg(message));
We post responses here - we don't email to your private email address.

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by