To resolve issues starting MATLAB on Mac OS X 10.10 (Yosemite) visit: http://www.mathworks.com/matlabcentral/answers/159016
im having problem on plot in matlab,
it asks me to plot prime numbers on a number line, and before this exercise i did wrote functions for to test if a number is prime, and find the prime numbers in a range,
and this is what i did,
test of Prime number:
Prime=true; for TestVal=2:sqrt(InVal) %if InVal is divisible by TestVal if mod(InVal,TestVal) == 0 Prime=false; end end end
find prime numbers in a range:
lowerlimit = input('Please enter a lower limit'); upperlimit = input('Please enter a upper limit');
for num=lowerlimit:upperlimit if PrimeNum(num) == 1 disp(num2str(num)) end end
and now i need to use the previous function to plot prime number on a number line, and this is what ive got so far but i have no idea if its on the right track, can anyone help me please?
xVec = length(xVec); yVec=zeros; plot(xVec, yVec,'o')
for if PrimeRange is PrimeNum() xVec=[xVec currentval]; end end
there is error occured and im not sure what im doing...
No products are associated with this question.