Loops on a Matlab program
- by lebland-matlab
I have 3 sets of 10 vectors each, and I want to take 2 vectors from the first set , 2 vectors from the second set and 3 vectors from the third set . My goal is to make a loop to implement the following program, knowing that after each calculation, the result shall be saved in a new file.
My problem is that I can not handle the indices included in the strings. I try to use multiple loops to scan the 3 sets in the order of indices. loops should contain the following program
clc;
clear all;
load('C:\Users\Documents\MATLAB\myFile\matrice_F.mat');
load('C:\Users\Documents\MATLAB\myFile\matrice_G.mat');
F = m_F;
G = m_G;
load('C:\Users\Documents\MATLAB\myFile\matrice_J.mat');
load('C:\Users\Documents\MATLAB\myFile\matrice_K.mat');
J = m_J;
K = m_K;
load('C:\Users\Documents\MATLAB\myFile\matrice_N.mat');
load('C:\Users\Documents\MATLAB\myFile\matrice_O.mat');
load('C:\Users\Documents\MATLAB\myFile\matrice_P.mat');
N = m_N ;
O = m_O;
P = m_P;
[A,B,C,D,E] = myFun(F,G,J,K,N,O,P);
file_name = 'matrice_final.mat';
save(file_name,'A','B','C','D','E');