Inputting a matrix to a function

1 vue (au cours des 30 derniers jours)
fsgeek
fsgeek le 11 Jan 2013
Hi guys,
I've got a function called "blockAnalysis" which uses matrices with any number of blocks:
DATA=[a1 a2 a3;b1 b2 b3;c1 c2 c3;...];
I pass this data to the function in the following way:
blockAnalysis(DATA);
I then get the following warning message:
??? Subscript indices must either be real positive integers or logicals.
Error in ==> MMM at 35
blockAnalysis(MinMaxXX,MinMaxYY,MinMaxZZ,MinMaxXY,MinMaxYZ,MinMaxXZ);
MinMaxXX, MinMaxYY etc. are different instances of the matrix DATA.
So is it not possible to have matrices as function inputs?

Réponse acceptée

Rick Rosson
Rick Rosson le 11 Jan 2013
>> doc varargin
>> doc varargout

Plus de réponses (1)

Azzi Abdelmalek
Azzi Abdelmalek le 11 Jan 2013
Try this
clear blockAnalysis
blockAnalysis(DATA);

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by