Error converting double to handle in close function

1 回表示 (過去 30 日間)
Mario Lorenzo
Mario Lorenzo 2021 年 5 月 18 日
コメント済み: Stephen23 2021 年 5 月 18 日
Hi guys,
I am currently running an issue. I am trying to run the following snippet:
%% This script generates the training dataset for the fully convolutional
% neural network by extracting patches with heatmap labels from the
% ThuderSTORM simulated data.
% start with a clean slate
close all; clear all;clc;
% set the default colormap
set(groot,'DefaultFigureColormap',gray);
close 1;
I am getting the following error:
Error using matlab.graphics.GraphicsPlaceholder/horzcat
Cannot convert double value 1 to a handle
Error in close
Error in GenerateTrainingExamples (line 10)
close 1;
I am not sure how to resolve this issue.
  2 件のコメント
Geoff Hayes
Geoff Hayes 2021 年 5 月 18 日
Mario - in the line of code
close 1;
what does the 1 refer to? What are you trying to close?
Stephen23
Stephen23 2021 年 5 月 18 日
Why does your code need to clear all cached functions from memory?

サインインしてコメントする。

回答 (1 件)

Walter Roberson
Walter Roberson 2021 年 5 月 18 日
close 1
means that MATLAB should first attempt to close a figure named '1' (character vector), and that if that fails, that MATLAB should attempt to convert '1' (character vector) to numeric and then try to close the figure that has that numeric handle.
The attempt would fail if there is no figure named '1' (character vector) and there is no figure whose handle number is 1.
Your code has "close all" so there would not be any open figures, so the close would not be able to find a figure named '1' or numbered 1 to close.

カテゴリ

Help Center および File ExchangeData Distribution Plots についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by