Num2Cell keeps adding onto data array

2 ビュー (過去 30 日間)
Vincent Erza
Vincent Erza 2016 年 11 月 12 日
編集済み: Walter Roberson 2016 年 11 月 13 日
I'm currently trying to take in multiple files from a directory, do calculations to them, and then save the file to a new directory. The problem I'm having is the num2cell function keeps adding onto the size of the array.
my first iteration
dataf = 9060 x 6
but then my second iteration through
dataf = 9060 x 12
example of a row:
1 2 3 4 5 6 nan nan nan nan nan nan
and this makes it so i cannot combine my matrix's to create the final output.
how do I get rid of the 'nan' issue that occurs.
clear
clc
[PathName,FileName] = uigetfile({'*.xlsx;*.csv'},'Select Data');
[num txt]=xlsread([FileName,PathName]);
length = size(txt,1);
lengthnum = size(num,1);
cd('C:\Users\name\Desktop\Stocks_new')
filename = PathName;
dataF = num;
dataF=num2cell(dataF);
title = txt(1,1:7);
dates = txt(2:length,1);
final = [title; dates dataF];
xlswrite(PathName,final,1)
  1 件のコメント
KSSV
KSSV 2016 年 11 月 13 日
Are you sure that the nans are not there in num?

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeCalendar についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by