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일

0 개 추천

function r = myfunc(x)
r = x(:,1).^2 + x(:,2).^2 - x(:,3).^2 ;

추가 답변 (0개)

카테고리

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

태그

질문:

Ian
2014년 1월 31일

편집:

2014년 1월 31일

Community Treasure Hunt

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

Start Hunting!

Translated by