Here is what I have:
coluna = zeros(2,3);
coluna(1) = func(3,2,1);
coluna(2) = func(3,4,5);
Here is example of the function:
function vec = func(a,b,c)
vec = zeros(3,1);
vec(1,1) = a*b*c;
vec(2,1) = a+b+c;
vec(3,1) = a-b-c;
end
This is only an example code, but it illustrate pretty much everything I mean by the problem.
In C++ lets say it would be like this:
int *func(int a,int b,int c){
int vet[2];
vet[0]=a*b*c;
vet[1]=a+b+c;
vet[2]=a-b-c;
return vet;
}
int main(){
int mat[1][2];
mat[0]=func(3,2,1);
mat[1]=func(3,4,5);
}
In MatLab it will give me this error:
In an assignment A(I) = B, the number of elements in B and I must be the same.
How may I fix this?