Loops on a Matlab program

Posted by lebland-matlab on Stack Overflow See other posts from Stack Overflow or by lebland-matlab
Published on 2010-04-09T17:49:05Z Indexed on 2010/04/09 17:53 UTC
Read the original article Hit count: 487

Filed under:

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');

© Stack Overflow or respective owner

Related posts about matlab