when i run matlab code this sentence appear?

when i run the code this sentence 'Undefined function or variable 'f'.' and this happens for all variable
  • note : the workspace in the program is empty
how can i fixed the problem????

답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2016년 4월 4일

0 개 추천

This message occurs when you use variables that are not defined. For example:
y=5*t
How Matlab will calculate 5*t if the variable t is not defined. the correct code is for example
t=10
y=5*t

댓글 수: 5

I defined it like that
f=zeros(5,5);
the problem is when i run the code the variable does not appear in workspace
What variable? What code?
In matlab R2015b when i run code , the variable does not appear in workspace
Walter Roberson
Walter Roberson 2016년 4월 4일
편집: Walter Roberson 2016년 4월 4일
If you had that line in a function, then the variable would be removed from the workspace as soon as that function returned.
Also, if you have a "clear" then you might be destroying the values. You should almost never have "clear all" in a program.
If i clear the variable from workspace how can restore it ???

이 질문은 마감되었습니다.

질문:

2016년 4월 4일

마감:

2021년 8월 20일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by