pretty and uitable gui

result of code
syms a b c
pretty[a^2;b/c]
is possible to insert into uitable- gui?
And also it is possible to put it into uitable into separately lines?
thanks

 採用された回答

Walter Roberson
Walter Roberson 2013 年 2 月 19 日

1 投票

T1 = [a^2;b/c];
T2 = evalc('disp(T1)');
Now T2 will be a char() array.
When you put it into separate lines in the uitable, do you want the raised 2 to be a separate line from the "a" ? Or do you want each of the expressions to become character arrays that you would insert one complete expression per cell ?

7 件のコメント

john
john 2013 年 2 月 19 日
Hi,
let T1 is matrix.
Then for example into cell 1,1 I want to put a^2 in pretty form. And for example into cell 1,2 I want to put b/c also in pretty form.
Walter Roberson
Walter Roberson 2013 年 2 月 19 日
for K = 1 : numel(T1)
T2{K} = evalc(sprintf('disp(T1{%d})', K));
end
john
john 2013 年 2 月 20 日
編集済み: john 2013 年 2 月 20 日
Hi,
your your last code doesn't work me. I got error : Error using ==> subsref Too many output arguments.
I thing it should be T2{K} = evalc(sprintf('disp(T1(%d))', K));
Result of that code is a^2,b/c, but not pretty code as
2
a
b
-
c
I need it to have in pretty form.
Walter Roberson
Walter Roberson 2013 年 2 月 20 日
Ah... try
for K = 1 : numel(T1)
T2{K} = evalc('disp(T1(K))');
end
john
john 2013 年 2 月 20 日
I think, that is again a^2 form. In your computer is it OK?
Walter Roberson
Walter Roberson 2013 年 2 月 20 日
I do not have the Mathworks MuPAD-based symbolic toolbox, so I am testing with the Maple-based symbolic toolbox; it is working for me in that.
john
john 2013 年 2 月 20 日
Maybe that is different, but thanks for help

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by