Passing cell array as input argument to function

조회 수: 4 (최근 30일)
Irina
Irina 2014년 12월 17일
답변: Guillaume 2014년 12월 17일
I'm trying to create a function that manipulates matrices which are elements of a cell array. I'm passing the cell array (temp_h) as an input argument, and getting an error message. What am I doing wrong? In the most stripped down form my code is:
function outds = mergeds_bbg(indset, varargin)
size(indset)
indset{1, 1}(end, :)
>> yld_hist = mergeds_bbg(temp_h); Undefined function 'mergeds_bbg' for input arguments of type 'cell'.

채택된 답변

Guillaume
Guillaume 2014년 12월 17일
The most common reason for getting the error "Undefined function xxxx for input arguments of type yyyy" is because the function is not on matlab path.
You can check if your function is on the path with:
which mergeds_bbg
Add its location to matlab's path or change your current folder to its folder.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Cell Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by