필터 지우기
필터 지우기

Multiplying individual columns of a matrix

조회 수: 3 (최근 30일)
Andrew MacPhee
Andrew MacPhee 2022년 11월 5일
댓글: Rik 2022년 11월 6일
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?

답변 (1개)

Rik
Rik 2022년 11월 5일
You need to index ytrain the other way around, not ytrain(:,n), but ytrain(n,:).
  댓글 수: 2
Andrew MacPhee
Andrew MacPhee 2022년 11월 5일
that did it, thank you
Rik
Rik 2022년 11월 6일
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.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by