How do I used the data from multidimensional loop and put it into a new equation and display the plot?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Mohamad Khairul Ikhwan Zulkarnain
am 12 Aug. 2018
Bearbeitet: Mohamad Khairul Ikhwan Zulkarnain
am 12 Aug. 2018
I got the coding below:
% creating a multidimensional array
files = dir('*txt') ; % you are in the folder with text files
N = length(files) ;
names = {files(:).name}' ;
iwant = cell(N,1) ;
for i = 1:N
iwant{i} = importdata(files(i).name) ;
end
% select which element is needed
% type iwant{i} where i refered to 1,2,3,....,n which refered to the number
% that has been assigned to each chemical element
A = input('Please enter an element in form of iwant{i}:');
% find the number of samples
n = length (A(:,1));
% step change for the wavelength
step = 0.02;
% wavelength which is at the centre
p = A(:,1);
% to make new wavelength for each of wavelength in the samples
for j=1:n
new_wavelength(j,:) = p(j)-step*10:step:p(j)+step*10;
end
format shortG
Now im stuck on how do i do another loop function to input the value i got into another equation and display it as a spectral line? This is the equation that the value should be put into and display as a result: L(lambda)=1/1+((lambda centre-lambda)/(delta lamda/2))^2 lambda centre should be that 11 column in each row and delta lambda for now is fix to 0.2.
I will attached the textfile that i used. Hope someone can help me with this.
Thank you!
0 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Cell Arrays finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!