It's about the edited file
14 views (last 30 days)
Show older comments
While writing the code in the live script it asked me to save the file to MATLAB. I entered "No". Then I started writing my code. I saved to a file in my PC but even after saving, it also didn't show in the current folder panel. Now in the command window, while adding the values to the variables, it is showing an error about "unrecognized function or variable".
1 Comment
Image Analyst
on 4 Aug 2023
Please attach screenshots showing your editor tabs and the current folder window (scrolled down to where your file name should show up) right after you save the file. Also do a screenshot of when you're "adding the values to the variables."
Answers (1)
Prateekshya
on 22 Aug 2023
As per my understanding you have saved the live script to some folder in your computer and not in MATLAB. In such cases it's possible that the variables defined in the live script are not recognized because the script was not executed or loaded into the MATLAB workspace.
You should first load the live script to MATLAB. Open the live script file you saved on your PC using the MATLAB Editor. You can search for it. Make sure the live script appears in the Editor window.
After executing the live script, check the Command Window for any error messages. If there are errors, review them and fix any issues in your code. Once the live script has been executed without errors, you should be able to access the variables defined in the script. You can use the Command Window to check if the variables are recognized by typing their names and pressing "Enter". If the variables are recognized, their values will be displayed.
If you still cannot see the file you saved in the Current Folder panel, make sure you are looking in the correct directory. You can use the "cd" command in the Command Window to change the current directory to the location where you saved the file. For example, if the file is saved on the "Desktop", you can use the following command to navigate to "Desktop" directory:
>> cd Desktop
By following these steps, you should be able to execute the live script, load the variables into the MATLAB workspace, and access them without encountering the "unrecognized function or variable" error.
0 Comments
See Also
Categories
Find more on File Operations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!