call matrix in function
古いコメントを表示
Hello I want to call special matrix that I created before via function only by name of matrix. for example I create
z1=[12 15 16;31 65 79;20 22 34]
I write this function:
function[f]= ave1(z1,z2)
z1=input('input z1 matrix: ')
[n1,n2]=size(z1);
n3=n1*n2
[n4,n5]=size(z2);
z2=input('input z2 matrix: ');
n6=n4*n5
B=reshape(z1,n3,1);
C=reshape(z2,n6n1);
f=[A(:);B(:)]
end
but when I run it in Matlab it can't khnow that. How can introduce or call my matrix in function only by name of matrix? Thank you
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Operating on Diagonal Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!