Error using variable in a function with trial version
Mostrar comentarios más antiguos
Hello,
I have a problem using my function Selection Sept. It told me that i use date as a function or a command but i don't know where. Why can't I name it in my script, use it in my function and then use it in my script again ? It worked on my friend computer who don't have the trial version but i do and on mine in doesn't work...
Thank you very much
1 comentario
Pestiaux Marianne
el 13 de Mayo de 2017
Respuesta aceptada
Más respuestas (1)
dpb
el 13 de Mayo de 2017
function [matrice] = SelectionSept (matrice)
for i = length(date):-1:1;
...
date isn't defined in your function excepting as the builtin Matlab function
>> which date
C:\ML_R2014b\toolbox\matlab\timefun\date.m
because functions have their own context and the array date you created in the script isn't passed to the function.
It would behoove you to not use builtin function names in general; confusion reigns when alias something this way.
While I do NOT recommend it; the code above would function if the sundtion were defined to use date as the argument; then it would become associated with the A array passed internally. BUT, do NOT do this; use some other variable name other than DATE!!!
1 comentario
Pestiaux Marianne
el 13 de Mayo de 2017
Categorías
Más información sobre Matrix Indexing en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!