필터 지우기
필터 지우기

Multi level cell multiplication

조회 수: 2 (최근 30일)
SUSHMA MB
SUSHMA MB 2015년 4월 7일
답변: Geoff Hayes 2015년 4월 7일
I have a cell of size 1x26. I want to multiply it with 100. How can i do it?

채택된 답변

Geoff Hayes
Geoff Hayes 2015년 4월 7일
Sushma - what are the elements of your cell array? If all of them are numeric arrays, then you could use cellfun to multiply each element in the cell array by 100. For example,
% create some random data
myCellData = cell(1,4);
myCellData{1} = randi(255,12,3);
myCellData{2} = randi(255,3,12);
myCellData{3} = randi(255,1,23);
myCellData{4} = randi(255,32,1);
% multiply each element by 100
newCellData = cellfun(@(x)100*x, myCellData,'UniformOutput',false);
Try the above and see what happens!

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by