While loop not working in MATLAB app designer callback function
古いコメントを表示
Hello there,
I making a simple app that reads numerical data inputed by the user and outputs arrays of data as result of some formula. In one of the callback functions, I have a while loop which, after the conditions is fulfilled, gives an array as a result. The function works correctly in the editor but in the app designer, it fails to recognise all the variables that are in the while loop.
Can anyone suggest what would be the possible reason behind this?
Thanks
回答 (1 件)
You probably have a scoping issue. Shared values are typically stored variable names such as app.myVariable
To give any more specific help you would need to provide the code you are using and the detailed error messages that you are receiving
7 件のコメント
Shivam Dubey
2020 年 10 月 2 日
Jon
2020 年 10 月 2 日
Actually I think these are the only arguments that the app designer callbacks can have. If you want to pass any data to them then put it into the app properties so you can access it inside of the callback function. Note in the appdesigner code view you can add properties using the property tab in the code browser (on the left side of the screen)
Shivam Dubey
2020 年 10 月 2 日
Jon
2020 年 10 月 2 日
Where is this function call made (I cut an pasted this from your error message above)?
Error in NewTemplate/CreateSpringingDataButtonPushed (line 121)
[WT_FAW,Total_BSLoad_FAW,Total_Load_FAW] = WheelTravelFAW(K_FAW,W_FAW,MR_FAW,BST_FAW,4000,9.81);
Note that it has 6 input arguments and your definition of WheelTravelFAW only has 4 input arguments. This is what is giving you the error. You need to find out where this call is coming from and fix it. From the error message. It looks like it comes from a function call CreateSpringingDataButtonPushed
Shivam Dubey
2020 年 10 月 2 日
Jon
2020 年 10 月 5 日
If you need more help please post the full error message you are now getting and even better attach enough code to reproduce the problem
カテゴリ
ヘルプ センター および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
