美文网首页
Matlab在曲线上做标记

Matlab在曲线上做标记

作者: focus_reality | 来源:发表于2018-05-26 19:23 被阅读0次

    读取文件

    data = xlsread('strain_stress.xlsx')
    strain = data(:, 1);
    stress = data(:, 2);
    myplot(strain,stress)
    

    函数文件

    function myplot(strain,stress)
    x_strain = [];
    y_stress = [];
    n = length(strain);
    distance = 20;
    for i = 1:distance
    x_strain = [x_strain; strain(floor(n * i / distance))];
    y_stress = [y_stress; stress(floor(n * i / distance))];
    end
    plot(strain, stress);
    hold on
    plot(x_strain,y_stress,'*');
    end
    

    相关文章

      网友评论

          本文标题:Matlab在曲线上做标记

          本文链接:https://www.haomeiwen.com/subject/rwxpjftx.html