Hi,
I want to do modfication(nested loop) in the current code limts[r,c].
I have twelve files avg_mat(i = 12) to Process . But each file needs to use diffrent r and c values in the code. I need to mutiply r and c with cosine theta for every file.
where theta increases from 0deg to max deg and decreases to 0deg at the end with the increment (max/number of files). Please help.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
results = zeros(numl(avg_mat),1);for i=1:numel(avg_mat) writematrix(avg_mat{i}, ['avg_val_' num2str(i)]); R = avg_mat{i}(:,1); C = avg_mat{i}(:,2); F = avg_mat{i}(:,5);maxi = 90;for t = [0:(maxi/numl(avg_mat)):maxi:-(maxi/numl(avg_mat)):0] r(t) = linspace(min(R), max(R), 1000)*cos(t);%need modification based the file
c(t) = linspace(min(C), max(C), 1000)*cos(t);%need modification based on the file
[Rg, Cg] = meshgrid(r(t), c(t)); Fg(i,t) = griddata(R, C, F, Rg, Cg); result(i,t) = trapz(c(t), trapz(r(t), Fg, 2));endend
Best Answer