my code wont run. was required to write a code to add charecters an store then in array

조회 수: 2 (최근 30일)
AccuSumNet({'123456789101112131415161718192021222324252627282930' '123456789101112131415161718192021222324252627282930123456789101112131415161718192021222324252627282930' '12345'});
function x=AccuSumNet(:,n)
y=x-'0';
sum(y);
AccuSumNet(:,n+1);
end

채택된 답변

David Hill
David Hill 2020년 5월 11일
function x=AccuSumNet(n)
for k=1:length(n)
x(k)=sum(n{k}-'0');
end
end
AccuSumNet({'123456789101112131415161718192021222324252627282930' '123456789101112131415161718192021222324252627282930123456789101112131415161718192021222324252627282930' '12345'});

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by