Hello.
I'm trying to create a function on Matlab that converts a base 10 (decimal) real number into another base.
I wrote this function:
function [converted_number] = base_converter(base,number,digits)
format longG
separator=' ';
radix_character='.';
digits=digits-1...
Hello.
I tried to make a program which simulated the movement of planets under the effect of the gravitational force. Here is my program:
n=5;
mass=1;
speed=0;
scale=3000;
distance=1;
time=200;
p=0.001;
G=1;
x=distance*(2*rand(1,n)-1);
y=distance*(2*rand(1,n)-1);
m=mass*rand(1,n)...
Hello.
Basically this is what I am trying to do:
for r=1:0.001:4
y=somefunction(r);
plot(x,y)
legend('r=',r)
pause(0.01)
end
It should make a succession of graphs, like a mini video, and we should have a legend showing the current value of the parameter 'r'.
But writing...