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

2 views (last 30 days)
AccuSumNet({'123456789101112131415161718192021222324252627282930' '123456789101112131415161718192021222324252627282930123456789101112131415161718192021222324252627282930' '12345'});
function x=AccuSumNet(:,n)
y=x-'0';
sum(y);
AccuSumNet(:,n+1);
end

Accepted Answer

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

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!