필터 지우기
필터 지우기

why can't my 2nd output argument in my function return any value?

조회 수: 1 (최근 30일)
Natalia Wong
Natalia Wong 2015년 12월 4일
댓글: Star Strider 2015년 12월 5일
Hi, I 'm trying to create a function that calculates the root from the the quadratic eqn. i need to display the two roots separately but why does my second root, k not appear from the output.argument. thanks i am new to matlab

채택된 답변

Star Strider
Star Strider 2015년 12월 4일
You have to ask it specifically for as many outputs as you want it to return. By default, if you only ask it for one, it will only return the first. This call returns all of them:
a = 2;
b = 5;
c = 10;
[j,k,group]=quadratic_roots(a,b,c)
Also, I would change:
group='non-equal complex valued roots'
to:
group='complex-conjugate roots'
  댓글 수: 11
Star Strider
Star Strider 2015년 12월 5일
@Natalia — If my Answer solved your problem, please Accept it.
@Walter — Thank you.

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by