필터 지우기
필터 지우기

what is deferent between Matlab2013a "ones" function with Matlab2013b

조회 수: 1 (최근 30일)
baran
baran 2014년 12월 2일
답변: Julia 2014년 12월 2일
dear all, i used a code in matlab2013a and it get answer to me, the code is :
M=xlsread('pars.xlsx','par10');
out10=cell2mat(arrayfun(@(x,y) x*ones(y,1),M10(:,1),M10(:,2),'un',0))
, But now i change my matlab to 2013b and the code doesnt work , the error is:
Error using ones
Size inputs must be integers.
Error in @(x,y)x*ones(y,1)
what is wrong with it? thanks

채택된 답변

Julia
Julia 2014년 12월 2일
Hi,
you use x and y as function parameters, so they can have non-integer values. But ones() creates a matrix, which needs to have integer values as dimensions.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by