Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. OmegaForce

    How to improve the precision of this base converter function on Matlab?

    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...
  2. OmegaForce

    Simulation of the motion of planets under the effect of the gravitational force

    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)...
  3. OmegaForce

    In a graph in a 'for' loop, how to add a legend with a variable/parameter in it?

    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...

Part and Inventory Search