Hey all,
Below is my function. I need to build the array automatically for the user input.
function suri1(Measuring_Data(:,7))%User input
X = {1, 2,'Node1'; 3, 4, 'Node2'; 5, 6, 'Node3'}; % different for different users
n = 10;d_T= 1 ;t = 200;S = load('Measuring_Data.mat');f = 0:d_T:(t-1)*d_T;p = cell2mat(X(:,1));q = cell2mat(X(:,2));disp(p);disp(q);T_Vorgabe = zeros(1,length(f)); % Row vector
for plotnumber = 1:n c = find(p == plotnumber,1); if ~isempty(c) c = plotnumber; for plotnumber1 = 1:n c1 = find(q == plotnumber1,1); if ~isempty(c1) c1 = plotnumber1; T_Vorgabe{c}(1,:) = S(c1,1); % May be worng syntax , All the values of the measuring data should be copied to T_Vorgabe as a row %vector or row cell array, c is the user input number to build the vector or cell array of different names
end end endendfigurehold('on')for plotnumber2 = 1:nc2 = find(p == plotnumber,1)if ~isempty(c2)c2 = plotnumber;plot(f(1:15:end)/200, T_Vorgabe{c2}); % Slover should plot all the values of T_Vorgabe(row vector or row cell array.
endendend
Here T_Vorgabe{c2} will be cell array. Now while plotting the T_Vorgabe solver should get the all the values stored from the respective cell arrayT_Vorgabe{c2}.
My questions are,
How to make T_Vorgabe as a row vector, or row cell array of different names according to user input?
Like below
T_Vorgabe{1}=[1,2,3,…,2920]
T_Vorgabe{2}=[2921,2922,2923,…,5840] etc
Any suggestions and answers are most welcomed.
Thanks in advance
Best Answer