could I display system as
x*[25
64
144]+y*
[5
5
12]+z*[
1
1
1]=[
289
345
123]
but the vectors are vertical

 채택된 답변

Walter Roberson
Walter Roberson 2017년 11월 16일

0 개 추천

The closest the symbolic toolbox can do is
>> x*[25;64;144] + y*[5;5;12] + z*[1;1;1] == [289;345;123]
ans =
25*x + 5*y + z == 289
64*x + 5*y + z == 345
144*x + 12*y + z == 123
>> pretty(ans)
/ 25 x + 5 y + z == 289 \
| |
| 64 x + 5 y + z == 345 |
| |
\ 144 x + 12 y + z == 123 /
It is not possible at the MATLAB level to prevent the multiplications from taking place (it is possible if you are working in a MuPad notebook.)
To get the output you are looking for, you will need to do the output formatting yourself.

댓글 수: 4

Eliza
Eliza 2017년 11월 16일
yes, I tried to make it in specific format but a lot of errors appear I used "display" function ,and nothing came true.
Eliza
Eliza 2017년 11월 16일
errors because I am interacting with the vectors as 'sym' and display in the only function for displaying this datatype ,and it does not accept multiple input at a time.
xm = [25;64;144];
ym = [5;5;12];
zm = [1;1;1];
rm = [289;345;123];
fprintf('x * [%5g; + y * [%5g; + z * [%5g; = [%5g;\n', xm(1), ym(1), zm(1), rm(1));
temp = [xm(2:end-1), ym(2:end-1), zm(2:end-1), rm(2:end-1)];
fprintf(' %5g; %5g; %5g; %5g;\n', temp.' ); %transpose is important
fprintf(' %5g] %5g] %5g] %5g]\n', xm(end), ym(end), zm(end), rm(end));
Eliza
Eliza 2017년 11월 16일
why i am getting this result when i run the previous code I mean the division not decimal as your code
if true
% code
25*x + 5*y + z == 534/5
64*x + 8*y + z == 886/5
144*x + 12*y + z == 1396/5
end

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Get Started with MuPAD에 대해 자세히 알아보기

태그

질문:

2017년 11월 16일

댓글:

2017년 11월 16일

Community Treasure Hunt

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

Start Hunting!

Translated by