Three element vector function?

조회 수: 3 (최근 30일)
Ian
Ian 2014년 1월 31일
편집: Walter Roberson 2014년 1월 31일
Create a MATLAB function that, given a three element vector [x1 x2 x3] as input, calculates r = x1^2 + x2^2 − x3^2.

채택된 답변

Amit
Amit 2014년 1월 31일
function r = myfunc(x)
r = x(:,1).^2 + x(:,2).^2 - x(:,3).^2 ;

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by