I'm trying to create a matrix of odd numbers, and I'm having some trouble. Any ideas? Thanks

11 次查看(过去 30 天)
function orms=odd_rms(nn)
lim = (nn * 2)-1;
odds = nums(1:2:lim); PROBLEM IS WITH THIS LINE
%(1:1:nn) = (odds(1:1:nn)^2);
%sumsquares =sum(squares)/nn;
orms =odds;
end

回答(1 个)

Ahmet Cecen
Ahmet Cecen 2016-11-12
You might have meant to do:
odds = 1:2:lim
as it is unclear what nums is in the scope of this function.

类别

Help CenterFile Exchange 中查找有关 Just for fun 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by