How to call a variable from one program to another program 2 in app designer?
1 次查看(过去 30 天)
显示 更早的评论
The problem I have is that in a first program I calculate variables "a" "b" "c" "d" etc.
I want to call these variables to a second program to use them in other equations.
In the first program I have a button that opens the second program.
When running I get the following error.
Error using /
Matrix dimensions must agree.
Error in app2Class/startupFcn (line 42)
app.Tabla1.Data{1, 2} = (24/a )+(3/(a ^0.5))+0.34;
Error in matlab.apps.AppBase/runStartupFcn (line 68)
ams.runStartupFcn(app, startfcn);
Error in app2Class (line 103)
runStartupFcn(app, @startupFcn)
Error in app1/Paso2ButtonPushed (line 438)
app2Class
Error in matlab.apps.AppBase>@(source,event)executeCallback(ams,app,callback,requiresEventData,event) (line 62)
newCallback = @(source, event)executeCallback(ams, ...
Error while evaluating Button PrivateButtonPushedFcn.
I want to clarify that "a" was already calculated.
Thanks for your help.
0 个评论
回答(1 个)
Stephen23
2023-10-15
I am guessing that you actually require element-wise division, not matrix division:
If you want to use MATLAB then you need to learn the difference between array operations and matrix operations.
app.Tabla1.Data{1, 2} = (24./a )+(3./sqrt(a))+0.34;
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!