02-8-2012, 10:14 PM
|
#9
|
FFR Player
Join Date: May 2007
Posts: 1,134
|
Re: MATLAB - The Language of Technical Computing
The problem I'm having is that when I try to find the location of the maximum value from 'factors', it does not seem to work. Instead of a displaying '6' as I would like it to, it gives me 1.
Code:
for vector = 6:10
factors(vector) = length(unique(factor(vector))); %Creates vector of the lengths of unique prime factors
a = find(max(factors));
end
disp(a)
Thanks for the help by the way.
Last edited by tangomango; 02-8-2012 at 10:16 PM..
|
|
|