matlab中怎么用将矩阵当成自变量带入函数运算?function [ DurF,AngF ] = FunF(F,PosF,x)if x = 0 DurF = F * x^2 *( x - 3 * PosF )/ ( 6 * E * I );AngF =(F*x^2)/(6*E*I) - (F*x*(3*PosF - x))/(3*E*I);elseif x >PosFDurF = F * x^2 *( 3 * PosF -
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/20 12:33:49
matlab中怎么用将矩阵当成自变量带入函数运算?function [ DurF,AngF ] = FunF(F,PosF,x)if x = 0 DurF = F * x^2 *( x - 3 * PosF )/ ( 6 * E * I );AngF =(F*x^2)/(6*E*I) - (F*x*(3*PosF - x))/(3*E*I);elseif x >PosFDurF = F * x^2 *( 3 * PosF -
matlab中怎么用将矩阵当成自变量带入函数运算?
function [ DurF,AngF ] = FunF(F,PosF,x)
if x = 0 DurF = F * x^2 *( x - 3 * PosF )/ ( 6 * E * I );
AngF =(F*x^2)/(6*E*I) - (F*x*(3*PosF - x))/(3*E*I);
elseif x >PosF
DurF = F * x^2 *( 3 * PosF - x )/ ( 6 * E * I );
AngF (F*x^2)/(6*E*I) - (F*x*(3*PosF - x))/(3*E*I);
else
error('所求位置不存在')
end
end
我想令F=[1,2,3],PosF=[1,2,3],x=[1,2,3],而且算出的结果要一一对应,应该怎么办?
matlab中怎么用将矩阵当成自变量带入函数运算?function [ DurF,AngF ] = FunF(F,PosF,x)if x = 0 DurF = F * x^2 *( x - 3 * PosF )/ ( 6 * E * I );AngF =(F*x^2)/(6*E*I) - (F*x*(3*PosF - x))/(3*E*I);elseif x >PosFDurF = F * x^2 *( 3 * PosF -
我建议把FUN函数的参数改为9个,如x1到x9,FunF(x1,x2.,x9)
运算时令前三个为F,即F=[x1,x2,x3]
中间三个为PosF,PosF=[x4,x5,x6]
后三个为x,x=[x7,x8,x9]