This is a code to solve simultaneous equations as lines how can I make it shorter?maybe defining it as a function?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I want to make shorter is there any way to do that
1 Kommentar
Walter Roberson
am 4 Dez. 2016
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?
Antworten (1)
Tamir Suliman
am 3 Dez. 2016
Bearbeitet: Tamir Suliman
am 3 Dez. 2016
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
Siehe auch
Kategorien
Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!