Problem with displaying format

1 回表示 (過去 30 日間)
emonhossain roy
emonhossain roy 2019 年 9 月 30 日
コメント済み: emonhossain roy 2019 年 10 月 1 日
I tired for displaying Value of f and conclusion but it seem not working. here is my code:
clc
clear all
syms x y
f(x,y)=x^3-3*x*y+y^3;
fx=diff(f,x);
fy=diff(f,y);
fxx=diff(fx,x);
fyy=diff(fy,y);
fxy=diff(fx,y);
D=(fxx*fyy)-(fxy)^2;
eqns=[fx==0,fy==0];
vars=[x y];
[sol_x sol_y]=solve(fx==0,fy==0,'Real',true);
conclusion={};
f_val=[];
for i=1:length(sol_x)
if( subs(D,{x,y},{sol_x(i),sol_y(i)})>0 && subs(fxx,{x,y},{sol_x(i),sol_y(i)})>0 )
conclusion{end+1}='min';
f_val(end+1)=f(sol_x(i),sol_y(i));
elseif(subs(D,{x,y},{sol_x(i),sol_y(i)})>0 && subs(fxx,{x,y},{sol_x(i),sol_y(i)})<0)
conclusion{end+1}='max';
f_val(end+1)=f(sol_x(i),sol_y(i));
elseif(subs(D,{x,y},{sol_x(i),sol_y(i)})<0)
conclusion{end+1}='saddle';
f_val(end+1)=f(sol_x(i),sol_y(i));
else
conclusion{end+1}='undetermine';
f_val(end+1)=f(sol_x(i),sol_y(i));
end
end
conclusion'
f_val'
result=[num2cell(f_val) conclusion']
error:
Error using horzcat Dimensions of matrices being concatenated are not consistent.
Any solution will be aprreciated.
Thanks in advance.th
  4 件のコメント
KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 10 月 1 日
When you use the following, then there is no error-
result=[num2cell(f_val) conclusion]
The answer provider on this Matlab Answer may not be from the same subject, it would be easy to answer, if you can provide us with the expected result?
emonhossain roy
emonhossain roy 2019 年 10 月 1 日
I attached a picture in my question. I want to display my output like it. Have you seen it? @KALYAN ACHARJYA

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeFormatting and Annotation についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by