24小时热门版块排行榜    

CyRhmU.jpeg
查看: 1624  |  回复: 14

z770428

金虫 (正式写手)


[求助] MATLAB 定义外部函数变量

各位高手,我用MATLAB求解热力耦合问题时,把温度场分析得到的热应变striant作为importdata输入到结构分析的workspace中运行结构分析主程序时,老是提示
??? Undefined function or variable 'straint'.
straint是一100*3矩阵,

我想问如何在结构分析主程序中定义straint?
回复此楼

» 猜你喜欢

» 本主题相关价值贴推荐,对您同样有帮助:

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

wgm096350

银虫 (正式写手)

愿有前程可奔赴,亦有岁月可回首
2楼2012-10-19 09:14:24
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

wgm096350

银虫 (正式写手)

请发图
愿有前程可奔赴,亦有岁月可回首
3楼2012-10-19 09:14:42
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

z770428

金虫 (正式写手)


引用回帖:
3楼: Originally posted by wgm096350 at 2012-10-19 09:14:42
请发图

您好,能帮帮我么
4楼2012-10-20 11:15:20
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

zhizi888888

银虫 (初入文坛)

【答案】应助回帖


感谢参与,应助指数 +1
xiegangmai: 金币+1, 谢谢参与 2012-10-21 20:06:49
不知道对不对啊,
Global
straint
踏踏实实做人,认认真真做事
5楼2012-10-20 12:23:21
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

z770428

金虫 (正式写手)


引用回帖:
5楼: Originally posted by zhizi888888 at 2012-10-20 12:23:21
不知道对不对啊,
Global
straint

Global
straint

这个我试了,不行,在WORKSPACE没结果
6楼2012-10-20 12:52:18
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

z770428

金虫 (正式写手)


引用回帖:
6楼: Originally posted by z770428 at 2012-10-20 12:52:18
Global
straint

这个我试了,不行,在WORKSPACE没结果...

??? Attempted to access straint(1); index out of bounds because numel(straint)=0.
7楼2012-10-21 08:57:35
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

z770428

金虫 (正式写手)


引用回帖:
5楼: Originally posted by zhizi888888 at 2012-10-20 12:23:21
不知道对不对啊,
Global
straint

??? Attempted to access straint(1); index out of bounds because numel(straint)=0.
8楼2012-10-21 08:57:52
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

wgm096350

银虫 (正式写手)

能把程序发一下不???这样子也不知道到底错在哪里啊
愿有前程可奔赴,亦有岁月可回首
9楼2012-10-21 15:48:30
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

z770428

金虫 (正式写手)


xiegangmai: 帖中代码部分可使用“插入代码”功能 2012-10-23 22:03:05
引用回帖:
9楼: Originally posted by wgm096350 at 2012-10-21 15:48:30
能把程序发一下不???这样子也不知道到底错在哪里啊

clear all; close all; clc; format compact; tic; global CRACK NODES straint ;

%%%% Pre-Processing %%%%%
inputQuasiStatic;                                                           % Define the geometry, materials, discontinuities

iter = numIterations;
for i = 1:iter
   
    %%%%% Processing %%%%%
    if i == 1, connectivity; pHDOF = []; else NODES(:,4:29) = 0; end        % Define connectivity
    omega           = levelSet(i);                                          % Create phi and psi, define enriched elements
   
    straint=?
    [DOF,DISP] = calcDOF;                                                   % Total degrees of freedom
    [updElem] = enrElem(i,pHDOF);                                          % Find enriched elements, inclusion elements
   
    if i == 1,
        globalK = displacementstiffnessMatrix(omega,DOF,iter,updElem);
                                                                               % Construct global stiffness matrix  %
     
    else globalK = updatedisplacementStiffness(globalK,omega,DOF,updElem,pHDOF);
    end                                                                    % Update the global stiffness matrix
    freeDOF         = boundaryCond(DOF);
    globalF        = forceVector(DOF,i,straint);                           % Construct global force vector
                                                                                 % Solve for the degrees of freedom
   
    DISP(freeDOF, = globalK(freeDOF,freeDOF)\globalF(freeDOF,;          % Find the nodal displacement values
   
    %%% Post-Processing %%%%%
    if i == iter, plotMain(omega,DISP); end                                 % Make plots
    if isempty(CRACK) == 0
        pHDOF    = 2*max(NODES(:,2));                                       % Maximum constant DOF at current iteration
        [KI,KII] = JIntegral(omega,DISP);                                   % Calculate the stress intensity factors
        exit     = growCrack(KI,KII,omega);                                 % Advance crack for quasi-static growth
        globalF        = forceVector(DOF,i,straint);
        if strcmp(exit,'YES') == 1
            disp('WARNING: No crack growth, iterations exited early.')
            plotMain(omega,DISP); break
        end
    end
   
    disp(['Iteration ',num2str(i),' completed. Elapsed time is ',num2str(toc,'%0.4f'),'.'])   
end
10楼2012-10-21 21:17:37
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 z770428 的主题更新
信息提示
请填处理意见