Info

この質問は閉じられています。 編集または回答するには再度開いてください。

function to change name when displays

3 ビュー (過去 30 日間)
Alina
Alina 2012 年 7 月 27 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hello,
I want to load a file and then check if there are missing values of the type
-99.99.
E.g.:
load('D:\My Documents\My work\ART_Value effect\Data\CRSP\marketindex_mon.txt');
checkmiss(marketindex_mon)
For this I wrote the file checkmiss:
function checkmiss(dataset)
% checks for missing values in dataset
idx=find(dataset==-99.99);
if isempty(idx)
fprintf('dataset has no missing values -99.99')
else
fprintf('dataset has missing values -99.99')
end
return;
I want it to display not 'dataset has no missing values -99.99' but 'marketindex_mon has no missing value', that is to always write the name of the dataset in question. Do you know how to do it?
Thank you.
  1 件のコメント
Walter Roberson
Walter Roberson 2012 年 7 月 27 日

回答 (1 件)

Titus Edelhofer
Titus Edelhofer 2012 年 7 月 27 日
Hi,
you could use the function inputname in your checkmiss function.
doc inputname
Titus

この質問は閉じられています。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by