Load real number, not integer

조회 수: 2 (최근 30일)
john
john 2013년 7월 8일
Hi,
why is not possible to load real number? For example "3.14"???
It works only with integer.
UserData.matrix(1,1)=num2cell(sym(char(strcat('_',get(handles.a,'String'),char(sym(UserData.matrix{1,1}))))));
Can you help me?
  댓글 수: 3
john
john 2013년 7월 9일
Sorry...I changed the code.
From edit text "a" a want load real number and than save into matrix.
I use matrix forexample for saving informations into folder,
Jan
Jan 2013년 7월 9일
The question is still not clear. Why do you add a leading underscore? Why do you make the expression symbolic? You can save informations to a folder, but to a file only. But even then it is not clear, how the extraction of the cell element UserData.matrix{1,1} is related to a loading.
So I try to guess a solution, but thuis does not match to your posted code in any way.

댓글을 달려면 로그인하십시오.

채택된 답변

Jan
Jan 2013년 7월 9일
From the text of your question, I'd extect this could be a solution:
UserData.matrix{1,1} = sscanf(get(handles.a, 'String'), '%g');
  댓글 수: 5
Jan
Jan 2013년 7월 9일
I cannot imagine what the conversions in these two lines should do:
UserData.matrix{1,1}=sscanf(strcat('||',get(handles.a, 'String'), ...
char((UserData.matrix{1,1}))), '%s');
vysledok(i,j)=cellstr(char(UserData.matrix{i,j}));
I have the strong impression that this can be done much more direct, but when it works as expected, who cares.
john
john 2013년 7월 10일
:-) yes

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Entering Commands에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by