How do I input a variable that contains a previous variable?
Ältere Kommentare anzeigen
The input for my function requires a letter "d" after a variable that I calculate, as shown below. I can't get it to work because I don't know the syntax for the code.
function [S0,S1,S2,S3] = calcStokes(n)
full_name = fullfile('I0R', n);
full_name2 = full_named;
I0value = I0(full_name2,full_name);
disp(I0value)
Above is the code that requires 2 inputs, one with the a name "n" and one with a name "nd"
Akzeptierte Antwort
Weitere Antworten (1)
Azzi Abdelmalek
am 25 Jul. 2015
Bearbeitet: Azzi Abdelmalek
am 25 Jul. 2015
function y=myfcn(n)
persistent nd
if isempty(nd)
nd=0
end
y=2*n+nd
nd=n
3 Kommentare
Sulaiman Alvi
am 25 Jul. 2015
Bearbeitet: Sulaiman Alvi
am 25 Jul. 2015
Azzi Abdelmalek
am 25 Jul. 2015
This is not clear
Sulaiman Alvi
am 25 Jul. 2015
Kategorien
Mehr zu Variables finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!