国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

MATLAB常見(jiàn)錯(cuò)誤之plot畫(huà)圖失敗

這篇具有很好參考價(jià)值的文章主要介紹了MATLAB常見(jiàn)錯(cuò)誤之plot畫(huà)圖失敗。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問(wèn)。

錯(cuò)誤使用 matlab.graphics.internal.newplotwrapper 嘗試將 SCRIPT newplotwrapper 作為函數(shù)執(zhí)行: C:\Program Files\Polyspace\R2020a\toolbox\matlab\graphics\+matlab\+graphics\+internal\newplotwrapper.m怎么解決

應(yīng)該是動(dòng)了newplotwrapper的內(nèi)部代碼

解決:

  1. 找到您的Matlab安裝文件夾。在Windows上,默認(rèn)情況下位于C:\Program Files\MATLAB\<MATLAB版本>

  2. 打開(kāi)toolbox\matlab\graphics\@matlab\graphics\internal文件夾。在該文件夾中,您可以找到名為newplotwrapper.m的文件,這是Matlab中的newplot函數(shù)的實(shí)際實(shí)現(xiàn)。

  3. 更改為:function axReturn = newplot(hsave)
    %NEWPLOT Prepares figure, axes for graphics according to NextPlot.
    % H = NEWPLOT returns the handle of the prepared axes.
    % H = NEWPLOT(HSAVE) prepares and returns an axes, but does not
    % delete any objects whose handles appear in HSAVE. If HSAVE is
    % specified, the figure and axes containing HSAVE are prepared
    % instead of the current axes of the current figure. If HSAVE is
    % empty, NEWPLOT behaves as if it were called without any inputs.
    %
    % NEWPLOT is a standard preamble command that is put at
    % the beginning of graphics functions that draw graphs
    % using only low-level object creation commands. NEWPLOT
    % "does the right thing" in terms of determining which axes and/or
    % figure to draw the plot in, based upon the setting of the
    % NextPlot property of axes and figure objects, and returns a
    % handle to the appropriate axes.
    %
    % The "right thing" is:
    %
    % First, prepare a figure for graphics:
    % Clear and reset the current figure using CLF RESET if its NextPlot
    % is 'replace', or clear the current figure using CLF if its
    % NextPlot is 'replacechildren', or reuse the current figure as-is
    % if its NextPlot is 'add', or if no figures exist, create a figure.
    % When the figure is prepared, set its NextPlot to 'add', and then
    % prepare an axes in that figure:
    % Clear and reset the current axes using CLA RESET if its NextPlot
    % is 'replace', or clear the current axes using CLA if its NextPlot
    % is 'replacechildren', or reuse the current axes as-is if its
    % NextPlot is 'add', or if no axes exist, create an axes.
    %
    % See also HOLD, ISHOLD, FIGURE, AXES, CLA, CLF.


    % Copyright 1984-2015 The MathWorks, Inc.
    % Built-in function.


    if nargin == 0 || isempty(hsave)
    hsave = [];
    elseif ~isscalar(hsave) || ~ishghandle(hsave)
    error(message('MATLAB:newplot:InvalidHandle'))
    else
    % Make sure we have an object handle.
    hsave = handle(hsave);
    end




    fig = gobjects(0);
    ax = gobjects(0);


    if ~isempty(hsave)
    obj = hsave;
    while ~isempty(obj)
    if strcmp(obj.Type,'figure')
    fig = obj;
    elseif strcmp(obj.Type,'axes')
    ax = obj;
    end
    obj = obj.Parent;
    end
    end


    if isempty(fig)
    fig = gcf;
    end


    fig = ObserveFigureNextPlot(fig, hsave);


    % Set figure's NextPlot property to 'add' after obeying the previous setting.
    fig.NextPlot = 'add';


    checkNextPlot = true;
    if isempty(ax)
    ax = gca(fig);
    if isa(ax,'matlab.graphics.axis.PolarAxes')
    if ishold(ax)
    error(message('MATLAB:newplot:HoldOnMixing'))
    else
    ax = matlab.graphics.internal.swapaxes(ax,@axes);

    % We just creaetd a new axes, no need to check NextPlot
    checkNextPlot = false;
    end
    end
    elseif ~any(ishghandle(ax))
    error(message('MATLAB:newplot:NoAxesParent'))
    end


    if checkNextPlot
    ax = ObserveAxesNextPlot(ax, hsave);
    end


    if nargout
    axReturn = ax;
    end






    function fig = ObserveFigureNextPlot(fig, hsave)
    %
    % Helper fcn for preparing figure for nextplot, optionally
    % preserving specific existing descendants.
    % GUARANTEED to return a figure, even if some crazy combination
    % of create / delete fcns deletes it.


    switch fig.NextPlot
    case 'new'
    % if someone calls plot(x,y,'parent',h) and h is an axes
    % in a figure with NextPlot 'new', ignore the 'new' and
    % treat it as 'add' - just add the axes to that figure.
    if isempty(hsave)
    fig = figure;
    end
    case 'replace'
    clf(fig, 'reset', hsave);
    case 'replacechildren'
    clf(fig, hsave);
    case 'add'
    % nothing
    end
    if ~any(ishghandle(fig)) && isempty(hsave)
    fig = figure;
    end


    function ax = ObserveAxesNextPlot(ax, hsave)
    %
    % Helper fcn for preparing axes for nextplot, optionally
    % preserving specific existing descendants
    % GUARANTEED to return an axes in the same figure as the passed-in
    % axes, even if that axes gets deleted by an overzealous create or
    % delete fcn anywhere in the figure.


    % for performance only call ancestor when needed
    fig = ax.Parent;
    if ~strcmp(fig.Type,'figure')
    fig = ancestor(fig,'figure');
    end


    switch ax.NextPlot
    case 'replaceall';
    cla(ax, 'reset', hsave);
    case 'replace'
    % If there are multiple data spaces, ax.prepareForPlot() will do a
    % reset of the properties for the active data space (while
    % preserving other data spaces) and return false to indicate that a
    % full reset is not necessary. Otherwise, ax.prepareForPlot() will
    % return true.
    if (ax.prepareForPlot())
    cla(ax, 'reset', hsave);
    else
    cla(ax, hsave);
    end
    case 'replacechildren'
    cla(ax, hsave);
    case 'add'
    % nothing
    end


    if ~any(ishghandle(ax)) && isempty(hsave)
    if ~any(ishghandle(fig))
    ax = axes;
    else
    ax = axes('Parent',fig);
    end
    end文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-617002.html

到了這里,關(guān)于MATLAB常見(jiàn)錯(cuò)誤之plot畫(huà)圖失敗的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來(lái)自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • MATLAB繪圖函數(shù)plot詳解

    MATLAB繪圖函數(shù)plot詳解

    一、引言 Matlab軟件提供了強(qiáng)大的可視化功能,可以根據(jù)給定的曲線上的坐標(biāo)來(lái)繪制曲線圖形,也可以根據(jù)已知的函數(shù)及自變量來(lái)繪制曲線圖形,也可以只給定自變量的取值范圍來(lái)繪制曲線,基本的Matlab函數(shù)是plot、fplot、ezplot、fimplicit等,本文詳述利用plot繪制二維曲線圖形的

    2024年02月12日
    瀏覽(25)
  • matlab:plot線型和顏色

    線型選項(xiàng): 實(shí)線:使用默認(rèn)的plot命令繪制的線條就是實(shí)線。 虛線:可以使用“–”選項(xiàng)來(lái)繪制虛線。例如:plot(x,y,‘–’)。 點(diǎn)線:可以使用“:”選項(xiàng)來(lái)繪制點(diǎn)線。例如:plot(x,y,‘:’)。 點(diǎn)劃線:可以使用“-.”選項(xiàng)來(lái)繪制點(diǎn)劃線。例如:plot(x,y,‘-.’)。 顏色選項(xiàng): Matla

    2024年02月05日
    瀏覽(22)
  • matlab繪圖plot常用設(shè)置

    matlab繪圖plot常用設(shè)置

    目錄 圖像的大小和位置 一個(gè)窗口畫(huà)多張子圖片 保存圖片 MATLAB 中設(shè)置 Figure 和 Axes 的位置和尺寸 - 知乎 (zhihu.com) https://zhuanlan.zhihu.com/p/446968474 示例: plot(t,y, \\\'Color\\\', [0,0,1],\\\'Linewidth\\\',1.5); set(gca,\\\'Position\\\', [.13 .60 .80 .30]); set(gca,\\\'linewidth\\\',1.2,\\\'fontsize\\\',14,\\\'fontname\\\',\\\'Times\\\'); xlim([0 2.5]); yli

    2024年02月10日
    瀏覽(25)
  • MATLAB plot繪圖顏色及配色

    MATLAB plot繪圖顏色及配色

    目錄: 1.matlab中的默認(rèn)縮寫(xiě)名稱顏色; 2. 采用RGB三元組指定顏色; 3. 采用16進(jìn)制顏色代碼(只是用于2019a版本及以后版本); 4. 參考 1. matlab中的默認(rèn)縮寫(xiě)名稱顏色 plot繪圖指定線條和數(shù)據(jù)標(biāo)記點(diǎn)的顏色,可以采用matlab中的默認(rèn)縮寫(xiě)名稱的顏色,如下表所示: 顏色名稱 縮寫(xiě)

    2024年02月12日
    瀏覽(16)
  • MATLAB | 如何用MATLAB如何繪制各式各樣精致的三元相圖(ternary plot)

    MATLAB | 如何用MATLAB如何繪制各式各樣精致的三元相圖(ternary plot)

    整了個(gè)大活,寫(xiě)了一個(gè)能夠生成非常精致三元相圖的函數(shù),這種圖主要用于展示三種變量之間的比例,本期實(shí)驗(yàn)繪制效果如下: 編寫(xiě)不易,這個(gè)工具寫(xiě)的腦殼痛,求多多點(diǎn)贊,依舊先介紹咋使用,工具函數(shù)放在最后,同時(shí)提供gitee及fileexchange下載鏈接,若是日后代碼更改會(huì)在

    2024年02月01日
    瀏覽(179)
  • MATLAB科學(xué)繪圖-MATLAB畫(huà)圖技巧與實(shí)例(一):常用函數(shù)

    MATLAB科學(xué)繪圖-MATLAB畫(huà)圖技巧與實(shí)例(一):常用函數(shù)

    Matlab擁有強(qiáng)大的繪圖功能,內(nèi)置了很多繪圖函數(shù),只需要給出一些基本參數(shù)就能得到所需圖形,這類函數(shù)稱為 高層繪圖函數(shù) 。 此外,Matlab還提供了直接對(duì)圖形句柄進(jìn)行操作的 低層繪圖操作 。這類操作將圖形的每個(gè)圖形元素(如坐標(biāo)軸、曲線、文字等)看做一個(gè)獨(dú)立的對(duì)象

    2024年02月03日
    瀏覽(26)
  • Matlab(畫(huà)圖進(jìn)階)

    Matlab(畫(huà)圖進(jìn)階)

    ? ? ? ? 目錄 大綱 ?1.特殊的Plots 1.1 loglog(雙對(duì)數(shù)刻度圖) ?1.3 plotyy(創(chuàng)建具有兩個(gè)y軸的圖形) ?1.4yyaxis(創(chuàng)建具有兩個(gè)y軸的圖) 1.5 bar 3D條形圖(bar3) 1.6 pie(餅圖) 3D餅圖 1.7 polar ?2.Stairs And Ste階梯圖 ?3.Boxplot 箱型圖和Error Bar誤差條形圖 3.1 boxplot ?3.2 errorbar ?4.fill(創(chuàng)建二維填充補(bǔ)片

    2024年02月10日
    瀏覽(20)
  • MATLAB-畫(huà)圖匯總

    MATLAB-畫(huà)圖匯總

    畫(huà)圖之前建議先想好自己要畫(huà)什么樣的圖,再去找相關(guān)代碼。 本文匯總了一些matlab畫(huà)圖代碼和修飾指令。 ? ? ? ? 連線圖就是連接一個(gè)又一個(gè)的點(diǎn),最后形成一個(gè)圖(折線圖),但是當(dāng)對(duì)進(jìn)行限制,比如x以一個(gè)極小的值從一個(gè)點(diǎn)增加到另一個(gè)點(diǎn)(例如:x=1:0.01:10),那么他們

    2024年02月02日
    瀏覽(21)
  • matlab畫(huà)圖(一、柱狀圖)

    matlab畫(huà)圖(一、柱狀圖)

    ?? 前言:柱狀圖利用柱子的高度,反映數(shù)據(jù)的差異。肉眼對(duì)高度差異很敏感,辨識(shí)效果非常好。柱狀圖的局限在于只適用中小規(guī)模的數(shù)據(jù)集。 ?? 目錄: 一、數(shù)據(jù)獲取 二、簡(jiǎn)單柱狀圖 三、分組柱狀圖 四、堆疊柱狀圖 一、數(shù)據(jù)獲取 統(tǒng)計(jì)圖的繪制離不開(kāi)數(shù)據(jù)的支撐。一般來(lái)說(shuō)

    2024年01月20日
    瀏覽(27)
  • matlab畫(huà)圖方法(持續(xù)更)

    創(chuàng)建畫(huà)布:figure(1); ? ? ? ? % 在同一個(gè)腳本文件里面,要想畫(huà)多個(gè)圖,需要給每個(gè)圖編號(hào),否則只會(huì)顯示最后一個(gè)圖 plot(x, y, \\\'o\\\', new_x, p, \\\'r--\\\') plot(x1,y1,x2,y2)? ????????在各個(gè)分塊位置創(chuàng)建坐標(biāo)區(qū)。 subplot(m,n,p)當(dāng)前圖窗劃分為 m×n 網(wǎng)格,并在 p 指定的位置創(chuàng)建坐標(biāo)區(qū)。 ??

    2024年02月12日
    瀏覽(25)

覺(jué)得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包