Hello everyone,
I want to write a program using as little for-loops as possible. I want to define the following multiplication:
[a b] * [x1 y1; x2, y2; x3 y3] = [a*x1 b*y1; a*x1 b*y1; a*x1 b*y1]
Can i do this without the use of for-loops?

 채택된 답변

Andrei Bobrov
Andrei Bobrov 2014년 3월 18일
편집: Andrei Bobrov 2014년 3월 18일

1 개 추천

bsxfun(@times,[a b],[x1 y1; x2, y2; x3 y3])
here a, b, x1, y1, x2, y2,x3, y3 - numeric

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Simulink Coder에 대해 자세히 알아보기

질문:

2014년 3월 18일

편집:

2014년 3월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by