matlab内存不足,如何解决?

发布于 2025-01-20 18:05:16 字数 1072 浏览 2 评论 0原文

MATLAB在trmatlab1(第172行)中显示错误,

f1=1./(19.42.*(1./t)+1./((1./2)+sqrt((1./4)-(1.918./(40.^2)).*t)));

我的目标是使用分段函数f1f2

    %data:
    p_2 = [ 0.0210
            0.0180
            0.3280
            1.3720
            1.8330
            1.8780
            2.0400
            2.0670
            2.0400
            0.1460
            0.1450
            0.1450];
        eta=[0.0020
            0.0020
            0.5200
            0.5020
            0.4840
            0.4640
            0.4440
            0.4260
            0.4240
            0.4230];
        figure(1);
        %Messwerttabelle geplottet:
        plot(p_2, eta, '+');
        grid on;
%parameter t:
        t=(0:1:1e8);
%positive root of the piecewise function f1
        f1=1./(19.42.*(1./t)+1./((1./2)+sqrt((1./4)-(1.918./(40.^2)).*t)));
%negative root of the piecewise function f1
        f2=1./(19.42.*(1./t)+1./((1./2)-sqrt((1./4)-(1.918./(40.^2)).*t)));
        hold on;
        plot(f1,f2);

MATLAB displays the error in TRmatlab1 (line 172)

f1=1./(19.42.*(1./t)+1./((1./2)+sqrt((1./4)-(1.918./(40.^2)).*t)));

My goal is to fit the ambiguous data with a piecewise function f1 and f2:

    %data:
    p_2 = [ 0.0210
            0.0180
            0.3280
            1.3720
            1.8330
            1.8780
            2.0400
            2.0670
            2.0400
            0.1460
            0.1450
            0.1450];
        eta=[0.0020
            0.0020
            0.5200
            0.5020
            0.4840
            0.4640
            0.4440
            0.4260
            0.4240
            0.4230];
        figure(1);
        %Messwerttabelle geplottet:
        plot(p_2, eta, '+');
        grid on;
%parameter t:
        t=(0:1:1e8);
%positive root of the piecewise function f1
        f1=1./(19.42.*(1./t)+1./((1./2)+sqrt((1./4)-(1.918./(40.^2)).*t)));
%negative root of the piecewise function f1
        f2=1./(19.42.*(1./t)+1./((1./2)-sqrt((1./4)-(1.918./(40.^2)).*t)));
        hold on;
        plot(f1,f2);

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文