How to link pushbotton and a m file(script)
Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
Ältere Kommentare anzeigen
Hi I don't know how to call a m file(script) through a pushbotton...I know that i have to do do something in the function pushbotton_Callback(......) but i don't Know what.. I tried this..
but nothing.
It appears me the following warning:
Antworten (6)
Walter Roberson
am 9 Nov. 2011
0 Stimmen
addpath() is only for use with directories, not individual files.
If you just want to execute the script, use run() -- but note that run() changes directories, so addpath() is better if you need to execute in the current directory.
Remember there is no point in using addpath() twice with the same path, so you may wish to check whether the target path is already on the path.
Vincenzo
am 9 Nov. 2011
0 Stimmen
Vincenzo
am 10 Nov. 2011
0 Stimmen
1 Kommentar
Walter Roberson
am 10 Nov. 2011
Your script confuses base workspace with function workspace.
Vincenzo
am 10 Nov. 2011
Vincenzo
am 10 Nov. 2011
0 Stimmen
3 Kommentare
Walter Roberson
am 10 Nov. 2011
Your code does not match up. Your earlier error message was about SEQ001 on line 8 of poi5, but the code you show has a dir() at line 8, and so is clearly a completely different routine.
Walter Roberson
am 10 Nov. 2011
The variables *are* being created, in the workspace of pushbutton2_Callback, and so they disappear again as soon as that callback finishes executing.
If you need your script to put the variables in the base workspace, then have it specifically put them there, such as by using assignin()
By the way, your code uses constructs that haven't been necessary since MATLAB 5.
Vincenzo
am 10 Nov. 2011
Vincenzo
am 11 Nov. 2011
0 Stimmen
Diese Frage ist geschlossen.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!