NoMan
NoMan

Reputation: 67

Equivalent MATLAB code from the Mathematica code

I have the following in Mathematica

n=5;
Xt = Table[t^i, {i, 0, n}]

The Mathematica outputs the following:

{1, t, t^2, t^3, t^4, t^5}

I want the equivalent MATLAB code. Please note the symbolic representation of the t .

Upvotes: 0

Views: 94

Answers (1)

rayryeng
rayryeng

Reputation: 104555

>> syms t;
>> n = 5;
>> Xt = t.^(0:n) 

Xt =

[ 1, t, t^2, t^3, t^4, t^5]

Upvotes: 1

Related Questions