Cant seem to this to line up. cell is created perfectly fine but strange issues happen.

1 回表示 (過去 30 日間)
Thomas Stolpe
Thomas Stolpe 2019 年 11 月 26 日
コメント済み: Bhaskar R 2019 年 11 月 26 日
I have no idea why cells are not where they should be
clc;
[X, Y] = parseCMC(30);
function [X, Y] = parseCMC(size)
X = repmat({''},size,15);
X2 = repmat({''},size,15);
soup = urlread('https://api.coinmarketcap.com/v1/ticker/');
indexes = strfind(soup, '"');
Y = zeros(size,2);
Y = num2cell(Y);
Y{1,1} = 'COIN';
Y{1,2} = 'PRICE (usd)';
k2 = 0;
for ii = 1 : size
level = (ii - 1) * 56 + 3;
for k = 1 : 15
start = indexes(level + (k - 1) * 4) + 1;
last = indexes(level + (k - 1) * 4 + 1) - 1;
X(ii, k) = cellstr(soup(start : last));
str = X(ii,k);
if k > k2
L = strlength(str);
if L == 3
k2 = 16;
end
switch L
case 3
start = indexes(level + (k - 1) * 4) + 1;
last = indexes(level + (k - 1) * 4 + 1) - 1;
iii = ii + 1;
Y{iii,1} = str;
otherwise
end
end
end
k2 = 0;
L = 0;
end
end

回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by