Symbolic object and uitable

Hi,
I have question and problem also with program in Matlab-guide.
My program works only with numbers 1,2,3......., but I need also insert to the uitable symbolic objects and calculate with symbolic objects also.
I want use uitable, and uitable should present matrix named for example a. I need insert numbers ” 1, 2, 3,…” and symbolic objects "a, b,c,.to the table.
Program is doing multiplication of two matrix.
Please, can you help my?
PS:
Here is example in M-file. i3 = sym(‘i3′,’real’); a=[ 0 0 i3; 1 2 3]; b=[2 2; 2 2; 2 2]; c=a*b;
But I need something like this in GUIDE with uitable.
If you have better idea, how could I fill the matrix, please let me know.

Respuestas (1)

Walter Roberson
Walter Roberson el 1 de Nov. de 2011

0 votos

You cannot put symbolic objects in a uitable.
If you have a uitable entry which you intend to be able to hold either a number or a symbol, then that uitable column must be set to be of character type, and any place that you suspect you may have a number, you have to check and convert the string representation of the number to a numeric value.
I have indicated both of the above facts to you in previous threads.

3 comentarios

john
john el 1 de Nov. de 2011
My english in not perfect. So do I understand, is it not possible what I need?
1. And how can I check and how can I convert the string representation of the number to a numeric value?
2. Can I create matrix like cell, then put in numbers and symbolic objects and then convert matrix to numbers? If yes, how?
3. So how can I fill my matrix with numbers and symbolic object?
john
john el 2 de Nov. de 2011
Mr. Walter Roberson,
could you help me? Please
I don't understand what to do, what do You mean in previous threads.
john
john el 2 de Nov. de 2011
I have one idea:
function pushbutton5_Callback(hObject, eventdata, handles)
h=findobj(0,'Type','figure','Tag','figure1');
UserData=get(h,'UserData');
syms R1 R2 R3 'real';
va=size(UserData.matrixA);
for i=1:va(1)
for j=1:va(2)
if (isnan(str2double(UserData.matrixA{i,j})))
MA(i,j)=findsym(UserData.maticaA{i,j});
else
MA(i,j)=str2double(UserData.maticaA{i,j});
end
end
end
MC=MA*MA;
set(handles.uitable2, 'Data',MC);
Problem is that UserData.matrixA{i,j} is type char: Undefined function or method 'findsym' for input arguments of type 'char'.
Maybe this idea is wrong

Iniciar sesión para comentar.

Categorías

Más información sobre Symbolic Math Toolbox en Centro de ayuda y File Exchange.

Preguntada:

el 1 de Nov. de 2011

Community Treasure Hunt

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

Start Hunting!

Translated by