# Convert a code to WL

Posted 9 months ago
1112 Views
|
4 Replies
|
1 Total Likes
|
 I have a question about to find an easy way for transforming a Matlab type vocabulary into the vocabulary of Mathematica. Maybe you can help me by an example from the book.Thats how it works on Matlab and Octave:Command Window: a = 3; v0 = 50/3.6; t = {1, 2, 3} v = v0 + a*t by pressing enter it is related to the true function, but by visualization, i have to generate a vector on a graph. I'm sure, that it's very similar but I won't find the true symbolic fields to create that.here is the example, how it would work on Matlab and also Octave:Command Window: t = 0:0.1:5; v = v0 + a*t; Plot [t,v,'b'] Axis{[0, 5, 0, 40]} GridOn xLabel['t in s'] yLabel['v in m/s'] The "'b'" stands that the graph is blue.Thanks for any response!Jias
4 Replies
Sort By:
Posted 9 months ago
 Hi Jeremias,It would help if you posted an image of the plot that is generated by Matlab / Octave. Is this what you are trying to do? ClearAll@v a = 3; v0 = 50/3.6; v[t_] := v0 + a*t Plot[v[t], {t, 0, 5}, PlotTheme -> "Detailed", FrameLabel -> {"t in s", "v in m/s"}] 
Posted 8 months ago
 It´s close, Here is, how it looks like in Octave 5.2
 Plot[v[t], {t, 0, 5}, PlotRange -> {{0, 5}, {0, 40}}, PlotTheme -> "Detailed", FrameLabel -> {"t in s", "v in m/s"}, PlotLegends -> None, AspectRatio -> 4/5]