How to fix error in matlab code for the assignment of path?

2 visualizaciones (últimos 30 días)
kuldeep
kuldeep el 13 de Sept. de 2024
Respondida: Walter Roberson el 14 de Sept. de 2024

I am using following lines of matlab code;
baseSNAP = "C:\Program Files\esa-snap\bin\gpt.exe";
cmd = [baseSNAP, aoFlag, out, oType, granule];
system(cmd);
it is giving the following error
Unrecognized function or variable 'baseSNAP'.
I request to please suggest me how to fix this error.
Kuldeep Tomar

  2 comentarios
dpb
dpb el 13 de Sept. de 2024
Presuming the other variables are defined, that code snippet would appear to be ok, but out of context by itself we can't tell what might have caused the error.
Post sufficient to reproduce the error here; creating that may well let you find and fix the problem yourself.
kuldeep
kuldeep el 13 de Sept. de 2024
Editada: kuldeep el 13 de Sept. de 2024
Thank you very much for your kind suggestions.

Iniciar sesión para comentar.

Respuestas (1)

Walter Roberson
Walter Roberson el 14 de Sept. de 2024
If it happened that there was a function named baseSNAP, and you have a call to that function, and as well you later assign to a variable named baseSNAP -- then the call to the function would generate that error message instead of calling the function or using the variable.
For example,
test()
Unrecognized function or variable 'abc'.

Error in solution>test (line 4)
abc()
function test
abc()
abc = 5;
abc()
end
function abc
fprintf('here\n');
end

Productos


Versión

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by