Filter löschen
Filter löschen

"reshape" does not give column vector entries in output

3 Ansichten (letzte 30 Tage)
Sergio
Sergio am 20 Mär. 2024
Bearbeitet: Sergio am 20 Mär. 2024
Running test_modified.m we obtain the vector entries for the residuals , as a 1x8 vector. However, with either
r = reshape([result{:}].',[],1) % column vector
r = reshape([result{:}].',1,[]) % row vector
I obtain no vector output. It says "Brace indexing is not supported for variables of this type."
What is wrong and how can I correct this?
Thanks
  4 Kommentare
Sergio
Sergio am 20 Mär. 2024
Thanks @Dyuman Joshi, but y0 is defined in enzyme.m which is called in test_modified.m
Sergio
Sergio am 20 Mär. 2024
Bearbeitet: Sergio am 20 Mär. 2024
@Stephen23 good point! In this case, it would be different, and not V = y1(:)-SP(:). With that, I get
V =
3.0146
-1.1146

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange

Produkte


Version

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by