This is a code to solve simultaneous equations as lines how can I make it shorter?maybe defining it as a function?

조회 수: 1 (최근 30일)
I want to make shorter is there any way to do that
  댓글 수: 1
Walter Roberson
Walter Roberson 2016년 12월 4일
Other than the line
disp('The lines are perpendicular to each other ');
what are the differences between the last second and third blocks in your plot? Perhaps they could be combined into one.
What should your code do if the last elseif is not true?

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

답변 (1개)

Tamir Suliman
Tamir Suliman 2016년 12월 3일
편집: Tamir Suliman 2016년 12월 3일
you could shorten it with many ways others also might be able to provide also different options
my answer is you could use a function that takes vectors or matrix fo a b and c
and then take the vector elements to be processed
function (v) v=[3 2 -5] a =v(1) b =v(2) c=v(3)
Please also add legends to your plot and titles
  댓글 수: 1
Gonzalo Reina
Gonzalo Reina 2016년 12월 3일
Thanks I already thought of using matrices but they want me to show how it can be solved algebraically But thanks I'll add the legend and title

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

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by