現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
古いコメントを表示
Hi,
where is the problem
UserData.matrix(1,2)=num2cell(sym(char(strcat(get(handles.edit7,'string'),',',get(handles.edit6,'String')))))
???
1 件のコメント
Walter Roberson
2013 年 3 月 12 日
Why the heck is the "sym" in there ??
採用された回答
John Petersen
2013 年 3 月 11 日
One too many parentheses ). Take one off.
10 件のコメント
john
2013 年 3 月 12 日
Witch one?
john
2013 年 3 月 12 日
Help, I need insert sym string into cell matrix, sym string I created from 2 edit boxes, and between them is one "," or another char
John Petersen
2013 年 3 月 12 日
nevermind, you have the right number of parentheses. What is sym?
why are you using num2cell? You don't have any numbers, just strings. If the strings are numbers you need to convert them using str2double().
john
2013 年 3 月 12 日
編集済み: Walter Roberson
2013 年 3 月 12 日
this code works :
UserData.matrix(1,2)=num2cell(sym(strcat('a',get(handles.edit7,'String'),'xx',get(handles.edit6,'String'),'xx',num2str(si_co_val))));
but this no, why?:
UserData.matrix(1,2)=num2cell(sym(strcat(get(handles.edit7,'String'),'xx',get(handles.edit6,'String'),'xx',num2str(si_co_val))));
different is only 'a'
John Petersen
2013 年 3 月 12 日
What error are you getting? Split the code into different lines so you can see which parts are working. I suspect it's a problem with sym(), since I don't know what that is doing.
john
2013 年 3 月 12 日
this is error:
??? Error using ==> sym.sym>convertExpression at 2547 Error: Unexpected 'identifier' [line 1, col 3]
Error in ==> sym.sym>convertChar at 2458 s = convertExpression(x);
Error in ==> sym.sym>convertCharWithOption at 2441 s = convertChar(x);
Error in ==> sym.sym>tomupad at 2195 S = convertCharWithOption(x,a);
Error in ==> sym.sym>sym.sym at 111 S.s = tomupad(x,'');
Error in ==> Simulator>pushbutton4_Callback at 642 UserData.celkovamatica(prv-1+3,2)=num2cell(sym(strcat(get(handles.edit7,'String'),'xx',get(handles.edit6,'String'),'xx',num2str(si_co_val))));
Error in ==> gui_mainfcn at 96 feval(varargin{:});
Error in ==> Simulator at 42 gui_mainfcn(gui_State, varargin{:});
Error in ==> @(hObject,eventdata)Simulator('pushbutton4_Callback',hObject,eventdata,guidata(hObject))
??? Error while evaluating uicontrol Callback
Walter Roberson
2013 年 3 月 12 日
Please break up the code
str7 = get(handles.edit7, 'String');
str6 = get(handles.edit6, 'String');
strsi = num2str(si_co_val);
symstr = strcat(str7, 'xx', str6, 'xx', strsi);
disp('symstr =')
symstr
assym = sym(symstr);
disp('assym =')
assym
ascell = num2cell(assym);
disp('ascell =')
ascell
UserData.matrix(1,2) = ascell;
there is the same fault. But I put into UserData.matrix(1,1)...there is no fault for plus value for example 7, but I got error for minus value for example -7...:-(
john
2013 年 3 月 19 日
I modified code in this form
UserData.matrix(1,1)=num2cell(sym(char(strcat(get(handles.edit5,'string'),'_',char(si_co_str{si_co_val}),'_',char(get(handles.edit6,'String'))))))
When I enter into edit6 number 5.4, than I got in matrix 54. But I need number 5.4....how can I solve that?
Please for help
John Petersen
2013 年 3 月 28 日
Please break up the code like this
a1 = get(handles.edit6,'String');
a2 = si_co_str{si_co_val};
a3 = get(handles.edit5,'string');
a4 = strcat(a3,'_',char(a2),'_',char(a1));
a5 = sym(char(a4));
UserData.matrix(1,1)=num2cell(a5);
Then perhaps we can see what's going on.
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Operations on Strings についてさらに検索
タグ
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
