Foskie Blue
Foskie Blue

Reputation: 21

What does this line mean in Matlab?

I am trying to understand what this line of code means in Matlab. I know what the plot function does but I can't seem to understand this: (d - sqrt(T)) * [1,1], [-1,1]

plot((d - sqrt(T)) * [1,1], [-1,1], 'g', 'linewidth', 2)

Upvotes: 0

Views: 67

Answers (1)

wgb22
wgb22

Reputation: 247

The x value is (d - sqrt(T)) * [1,1] which actually produces x = [d-sqrt(T), d-sqrt(T)] assuming that d and T are both constants; and y = [-1, 1].

This code will therefore plot a vertical green line of thickness 2, between y-values -1 and 1, at the x value of d-sqrt(T).

Upvotes: 1

Related Questions