matlab 想留住一组正实数解ans =[ .1846536138869924146643935,7.986748005492751499324976,1421.3443803903520135420418095598][ .1845273287168265848989651-.518860744535330417140e-4*i,7.98128584415339900082029-.224420737255765751358e-2*i,-921.90365

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/27 02:57:26
matlab想留住一组正实数解ans=[.1846536138869924146643935,7.986748005492751499324976,1421.344380390352013542041

matlab 想留住一组正实数解ans =[ .1846536138869924146643935,7.986748005492751499324976,1421.3443803903520135420418095598][ .1845273287168265848989651-.518860744535330417140e-4*i,7.98128584415339900082029-.224420737255765751358e-2*i,-921.90365
matlab 想留住一组正实数解
ans =
[ .1846536138869924146643935,7.986748005492751499324976,1421.3443803903520135420418095598]
[ .1845273287168265848989651-.518860744535330417140e-4*i,7.98128584415339900082029-.224420737255765751358e-2*i,-921.90365305631302770115467835537+2642.4306206792349087655207542102*i]
[ 1.1366167570295502195622499015334,49.161624438994386659266864253174,-.51369034214749980310243736041245e-2]
[ -.17556935386503744353325080508e-2,-.75938301844739378690852424348e-1,-.99214670347055175139636111517488]
[ .320434219084204372529383330975e-1,1.385961155208496420974841396949,-1.1750983631415945437001650354278]
[ .1845273287168265848989651+.518860744535330417140e-4*i,7.98128584415339900082029+.224420737255765751358e-2*i,-921.90365305631302770115467835537-2642.4306206792349087655207542102*i]
有这样一组解,由于是实际问题,负数和虚数是不符合条件的,怎么能得到我要的整实数解啊,请大侠们帮忙了.
我用rea()>0和imag()=0语句挑选出来的结果有7个,我怎么得到第一行的那个解啊?

matlab 想留住一组正实数解ans =[ .1846536138869924146643935,7.986748005492751499324976,1421.3443803903520135420418095598][ .1845273287168265848989651-.518860744535330417140e-4*i,7.98128584415339900082029-.224420737255765751358e-2*i,-921.90365
修改后的
clc
clear
format long
date=[[ .1846536138869924146643935,7.986748005492751499324976,1421.3443803903520135420418095598]
[ .1845273287168265848989651-.518860744535330417140e-4*i,7.98128584415339900082029-.224420737255765751358e-2*i,-921.90365305631302770115467835537+2642.4306206792349087655207542102*i]
[ 1.1366167570295502195622499015334,49.161624438994386659266864253174,-.51369034214749980310243736041245e-2]
[ -.17556935386503744353325080508e-2,-.75938301844739378690852424348e-1,-.99214670347055175139636111517488]
[ .320434219084204372529383330975e-1,1.385961155208496420974841396949,-1.1750983631415945437001650354278]
[ .1845273287168265848989651+.518860744535330417140e-4*i,7.98128584415339900082029+.224420737255765751358e-2*i,-921.90365305631302770115467835537-2642.4306206792349087655207542102*i]]
[l,c]=size(date);
re=[];%存储结果
for p=1:l
if(isreal(date(p,:)) & (real(date(p,:))>0)/3)
re=[re ;date(p,:)];
end
end
re

假设你的结果是存在result里
result = result( isreal(result) & (result > 0) );
补充:
理解错了,你的解是一行,不是一个数
可以这样:
result = result(all(imag(result)==0, 2), :);
imag(result)==0 得到所有的实数
all(ima...

全部展开

假设你的结果是存在result里
result = result( isreal(result) & (result > 0) );
补充:
理解错了,你的解是一行,不是一个数
可以这样:
result = result(all(imag(result)==0, 2), :);
imag(result)==0 得到所有的实数
all(imag(result)==0, 2)得到列方向上全是实数的行

收起

matlab 想留住一组正实数解ans =[ .1846536138869924146643935,7.986748005492751499324976,1421.3443803903520135420418095598][ .1845273287168265848989651-.518860744535330417140e-4*i,7.98128584415339900082029-.224420737255765751358e-2*i,-921.90365 matlab中如何定义一个正实数的变量 matlab得的结果中如何将虚数化为实数我在matlab中得到的结果中有这样的式子:ans= 0.46932174371369178304*i+0.270963035069644504370.67687908320699561522*i-0.39079632089838601476-0.67687908320699561522*i-0.390796320898386014760 【有截图】请问这个MATLAB的这个ans是什么意思啊? matlab中,ans的性质我接一个方程,解得的ans有三个解,我只要中间(大小)那个,或者最大那个也行,如何编程选取呢?ans的数据是以何种形式存在的?如何将它转换为其他形式的数据 matlab程序问题0减255竟然等于0A(53,72)ans =0>> B(53,1)ans =255>> A(53,72)-B(53,1)ans =0有谁看下哪里出问题了A,B都是矩阵,各取一个元素0,255想减竟然等于0! matlab一段小代码的疑问for i=0.2:0.2:0.8,i*10,endans =2ans =4ans =6.0000 这个是怎么回事?ans =8 已知联立方程y=x的2次方-kx+34,y=6x-3k只有一组实数解,其中k是正常数.解该联立方程. 求救!matlab题:给定一实数矩阵A,试写一组指令,将其所有NaN元素设定为0 matlab solve 问题clear all;clc;solve('a+5=0','a');然后matlab 显示ans 为,没有具体解.不知道这是为什么,难道是我solve 理解有问题? 长绳系日造句 长绳系日:表达想留住时光. matlab!>> format,intmax('uint64'),realmaxans =18446744073709551615ans =1.7977e+308 matlab如何表示复数s=i;>> real(s)ans =1怎么破 matlab中判定 0==1==0 ans=1 是怎么回事? 为什么MATLAB中3*acos(-1/2)==2*pi 的 ans=0? Matlab任意精度计算支持吗?>> vpa(cos(3),1000)ans =-.9899924966004454152113112286315299570560455322265625000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 线性代数里的 * 比如matlab里的ans =8 * * * -4 * * * -4 还有 matlab求解复数方程为什么解例如x^2=-1时得x=+-i,下次再算的时候就变成x=+-sqrt(-1)我的代码 solve('x^2=-1') ans i -i 第二次 >> solve('x^2=-1') ans = sqrt(-1) -sqrt(-1)