The Normal Equation and QR My Solutions

2 vues (au cours des 30 derniers jours)
Doga Ersuz
Doga Ersuz le 19 Juin 2022
Commenté : William Rose le 20 Juin 2022
% discretize t on [-2,2] with h=0.01 (as a column vector)
How can I do that?
  6 commentaires
Doga Ersuz
Doga Ersuz le 20 Juin 2022
Thanks for your interest and answer. I'm doing [-2:0.01:2] or (-2:0.01:2)' to create a column vector but it gives error. I'm struggling to understand my mistake.
Torsten
Torsten le 20 Juin 2022
Works for me.
t = (-2:0.01:2)'
t = 401×1
-2.0000 -1.9900 -1.9800 -1.9700 -1.9600 -1.9500 -1.9400 -1.9300 -1.9200 -1.9100

Connectez-vous pour commenter.

Réponses (1)

William Rose
William Rose le 20 Juin 2022
Modifié(e) : William Rose le 20 Juin 2022
@Doga Ersuz, It looks like your professor has provided a partial script in which you must fill in the right hand side on lines 6, 10, and 12. Hints: Line 6 should create a vector that is 401x1 (rows by columns). @Torsten's hint is the key for line 6. Line 10 should create a 401x5 matrix. Line 12 should create a 5x1 vector. You do not need a for loop for any of these lines, which is one of the nice things about Matlab. Line 15 of the script looks like a mistake, for several reasons.
  2 commentaires
Doga Ersuz
Doga Ersuz le 20 Juin 2022
Thanks for your answer.
William Rose
William Rose le 20 Juin 2022
@Doga Ersuz, you;re welcome, and good luck with your work.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Programming dans Help Center et File Exchange

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by