Borrar filtros
Borrar filtros

Multiplying individual columns of a matrix

3 visualizaciones (últimos 30 días)
Andrew MacPhee
Andrew MacPhee el 5 de Nov. de 2022
Comentada: Rik el 6 de Nov. de 2022
I'm trying to multiply each individual row of ytrain(by the given values) and save it as a column in theta. When I do it individually(as you can see by the theta1, theta2, ext, below) it works fine. It creates 10 785x1 vectors. But doing it like this I keep getting error's. I just don't want to have 10 different lines for this, but I'm not sure what I'm doing wrong here. Any thoughts?

Respuestas (1)

Rik
Rik el 5 de Nov. de 2022
You need to index ytrain the other way around, not ytrain(:,n), but ytrain(n,:).
  2 comentarios
Andrew MacPhee
Andrew MacPhee el 5 de Nov. de 2022
that did it, thank you
Rik
Rik el 6 de Nov. de 2022
You're welcome. If my answer solved the problem, please consider marking it as accepted answer. If you have any remaining issues, feel free to post a comment with details.

Iniciar sesión para comentar.

Categorías

Más información sobre Programming en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by