Hello there! Can you please guide me on 'how to control, I mean access and edit the values of an n-D look up table which is present there in a Simulink model' using the callback function in MATLAB App Designer. Thank you.
Hello I am getting an error stating "Brace indexing is not supported for variables of this type. " After I got error with TextArea I have written as "app.EditField.Value = [app.EditField.Value{1} event. Source. Text] ; Can you please help?
Complete code of this project is shared in the below link for reference: programmerworld.co/matlab/design-a-gui-in-matlab-using-appdesigner-create-a-simple-calculator/ I hope it is useful. Cheers Programmer World programmerworld.co -
I had to do this instead using an EditField: % Saves the desired value into result result = [app.EditField.Value '1']; % Concatenates what's already in the edit field with result app.EditField.Value = result;
Hello sir I want to find root of arithmatic polynomial expression, in matlab appdesigner . My code is like that, Input1=app.Input2EditField.Value; Input2=app.Input2EditField.Value; . . . x=[Input1,Input2,....]; C=roots(x); app.textArea.Value=C; But It doesnot work ?Can you helpme please?
Good video, thanks for sharing. I have a question. How can you create a button that display a warning with a sound or beep? like for example, i have a temperature reader, I can show the room temperate but i would like to set an alarm if temperature reaches 30 celcius.
Please watch my below video. This would help you to design the alarm. How to create an Alarm Clock in MATLAB App Designer in Simple Steps? th-cam.com/video/EHFmqGjTciw/w-d-xo.html If you still have any questions then let me know.
Just use "extractBefore" on "app.TextArea.Value" by leaving the last value. Then update the value back to this. Something like below would work: >> app.TextArea.Value = extractBefore(app.TextArea.Value, strlength(app.TextArea.Value)); Details of this video is also available at: programmerworld.co/matlab/design-a-gui-in-matlab-using-appdesigner-create-a-simple-calculator/
I am not sure why you are using horzcat. To concetanate and form a string you can directly use big square brackets [ ]. However, for the error you are getting, I guess you are not converting all the elements in horzcat to same datatype or are of same size. Like probably you are missing num2string for certain numerical values or are having variables with different dimensions. If you can send your complete code then I can quickly check and let you know about the issue.
If I want to include a button named 'Advance' such that when I click on it ANOTHER app(AdvncedCalculator) with more function(sin, cos etc) opens. Similarly on this Advanced Calculator I want to include a button named 'Simple' such that when I click on it the PREVIOUS app(SimpleCalculator) opens again. How to make this?
I understand your requirement. So, basically what you can do is first design your calculator. And then from callback of your ‘Advance’ button you control the visibility of the buttons you want to display.
In fact you can also control the text of the button in the callback and rename/ toggle the name between ‘Advance’ and ‘Basic’ based on the usage. I will try to make a video to show this today. Will let you know once I create it.
If needed you can watch my below video: th-cam.com/video/cv3hK_vCNgg/w-d-xo.html This video shows how you can toggle between simple and advance calculator buttons.
@@shubhamforeverything From the error message, it seems that the name of the widget in your gui is not TextArea but something else. So, the tool throws the error that the variable not found. Please check the name of text box in the layout. Also please note, the name may be case sensitive. So add the letters in the same case.
You can check it on Matlab help or you can refer to the respective webpage with the below link: mathworks.com/help/matlab/app-designer.html Hope it helps. Cheers.
Vey good video, but if You want to multiply 2 and 6, You won't get a summary called: "2*6=12", but just "12", so You could modify Your code in "=" button, it will be just: app.TextArea.Value = [num2str(eval(app.TextArea.Value{1}),'%.3f')];
Yes, you are right. But I also wanted to retain and show the operation done to get a result. So, it displays complete 2*6=12. However, you are right. We could only display the final result also which is 12. Thanks for your comment.
you are a big man dude.You save my life thanks ++
Good one sir🙏
So good at explaining and very helpful
Hello there!
Can you please guide me on 'how to control, I mean access and edit the values of an n-D look up table which is present there in a Simulink model' using the callback function in MATLAB App Designer.
Thank you.
Hello I am getting an error stating "Brace indexing is not supported for variables of this type. "
After I got error with TextArea I have written as "app.EditField.Value = [app.EditField.Value{1} event. Source. Text] ;
Can you please help?
Complete code of this project is shared in the below link for reference:
programmerworld.co/matlab/design-a-gui-in-matlab-using-appdesigner-create-a-simple-calculator/
I hope it is useful.
Cheers
Programmer World
programmerworld.co
-
I had to do this instead using an EditField:
% Saves the desired value into result
result = [app.EditField.Value '1'];
% Concatenates what's already in the edit field with result
app.EditField.Value = result;
How can I take the input values as complex numbers
Hello sir I want to find root of arithmatic polynomial expression, in matlab appdesigner .
My code is like that,
Input1=app.Input2EditField.Value;
Input2=app.Input2EditField.Value;
.
.
.
x=[Input1,Input2,....];
C=roots(x);
app.textArea.Value=C;
But It doesnot work ?Can you helpme please?
Is there any tutorial available to run GUI with already written scripts?
Good video, thanks for sharing. I have a question. How can you create a button that display a warning with a sound or beep? like for example, i have a temperature reader, I can show the room temperate but i would like to set an alarm if temperature reaches 30 celcius.
Please watch my below video. This would help you to design the alarm.
How to create an Alarm Clock in MATLAB App Designer in Simple Steps?
th-cam.com/video/EHFmqGjTciw/w-d-xo.html
If you still have any questions then let me know.
I want to make a button which can delete only the last entry.Can anyone help me with the function?
Just use "extractBefore" on "app.TextArea.Value" by leaving the last value. Then update the value back to this.
Something like below would work:
>> app.TextArea.Value = extractBefore(app.TextArea.Value, strlength(app.TextArea.Value));
Details of this video is also available at:
programmerworld.co/matlab/design-a-gui-in-matlab-using-appdesigner-create-a-simple-calculator/
Error using horzcat
Dimensions of arrays being concatenated are not consistent. I am getting this problem in first value. Solution?
I am not sure why you are using horzcat. To concetanate and form a string you can directly use big square brackets [ ].
However, for the error you are getting, I guess you are not converting all the elements in horzcat to same datatype or are of same size. Like probably you are missing num2string for certain numerical values or are having variables with different dimensions.
If you can send your complete code then I can quickly check and let you know about the issue.
If I want to include a button named 'Advance' such that when I click on it ANOTHER app(AdvncedCalculator) with more function(sin, cos etc) opens. Similarly on this Advanced Calculator I want to include a button named 'Simple' such that when I click on it the PREVIOUS app(SimpleCalculator) opens again.
How to make this?
I understand your requirement. So, basically what you can do is first design your calculator. And then from callback of your ‘Advance’ button you control the visibility of the buttons you want to display.
In fact you can also control the text of the button in the callback and rename/ toggle the name between ‘Advance’ and ‘Basic’ based on the usage.
I will try to make a video to show this today. Will let you know once I create it.
If needed you can watch my below video:
th-cam.com/video/cv3hK_vCNgg/w-d-xo.html
This video shows how you can toggle between simple and advance calculator buttons.
thanks for such quick response.
app.TextArea.Value=[app.TextArea.Value{1} event.Source.Text];
Showing error what to do bro..??
What is the error message?
Can you copy the complete function of your code which is giving error?
@@ProgrammerWorld No appreciate method, property,or field'TextArea' for class 'SIMPLE_CALCULATOR'.
@@shubhamforeverything From the error message, it seems that the name of the widget in your gui is not TextArea but something else. So, the tool throws the error that the variable not found. Please check the name of text box in the layout.
Also please note, the name may be case sensitive. So add the letters in the same case.
Where can I find documentation for app designer?
You can check it on Matlab help or you can refer to the respective webpage with the below link:
mathworks.com/help/matlab/app-designer.html
Hope it helps. Cheers.
Vey good video, but if You want to multiply 2 and 6, You won't get a summary called: "2*6=12", but just "12", so You could modify Your code in "=" button, it will be just: app.TextArea.Value = [num2str(eval(app.TextArea.Value{1}),'%.3f')];
Yes, you are right. But I also wanted to retain and show the operation done to get a result. So, it displays complete 2*6=12. However, you are right. We could only display the final result also which is 12.
Thanks for your comment.