Hi;
My problem is that I want to have a table of result including the first coloumn is "R" (from 2 to 7) and the second one is "N_states" (for each "R" I should have a spesefic "N_states") and then plot the table. (Hint: the code (from line 3 to 11) generets just one "N_states" for one "R = 7" corectly but I want to have different "N_states" for different "R" and then plot "N_states" vers. "R")
This is my code:
for R = 2:7%
%R = 7;
N_states = 0; for nx = 1:R for ny = 1:R if ((nx.*nx + ny.*ny) <= R.*R) N_states= N_states + 1; end end end % R = R + 1;endT = table(R(:),N_states(:));plot (T)
Best Answer