- show us the complete error message. This means all of the red text.
- Show us the actual code you re using (currently your code is missing some square brackets, which indicates that some of it is missing.
Need help fixing Vercat error
1 次查看(过去 30 天)
显示 更早的评论
load efa_big.mat;
DateStr = datestr('2019-09-04', 'yyyy-mm-dd');
efa = efa_big;
DS_TRADES = ['SELECT DISTINCT '...
'PORTFOLIO, '...
'BUY_SELL_FIX_FLT_NAME, '...
'RUN_DATE, '...
'ISSUER_NAME, '...
'BMK_ISSUER_NAME, '...
'ISSUER_GROUP, '...
'FROM efa '...
'WHERE RUN_DATE(''', DateStr, ''', ''YYYY-MM-DD'') AND '...
'PORTFOLIO = ''Euro Inv'' AND '...
'BUY_SELL_FIX_FLT_NAME = (''Buy'', ''Sell'')'
];
I get the error
"Error using vertcat
Dimensions of arrays being concatenated are not consistent."
What I'm trying to do is in the dataset efa_big I want to pull all the specific column names from line 6-12
DS_TRADES = ['SELECT DISTINCT '...
'PORTFOLIO, '...
'BUY_SELL_FIX_FLT_NAME, '...
'RUN_DATE, '...
'ISSUER_NAME, '...
'BMK_ISSUER_NAME, '...
'ISSUER_GROUP, '...
and filter it for the date range specified, the portfolio name and for all our buys and sells. any idea why I'm getting this error?
'FROM efa '...
'WHERE RUN_DATE(''', DateStr, ''', ''YYYY-MM-DD'') AND '...
'PORTFOLIO = ''Euro Inv'' AND '...
'BUY_SELL_FIX_FLT_NAME = (''Buy'', ''Sell'')'
];
Thanks
5 个评论
Stephen23
2019-10-9
编辑:Stephen23
2019-10-9
"the date in the dataset is numeric so this converts it to an actual date."
That does not explain much, as your code does not use any "datset" as an input to datestr.
What are these lines for? (note that you do not actually use efa anywhere):
load efa_big.mat;
efa = efa_big;
Most likely your DateStr has multiple rows, which will throw that error. But as you provided us with some non-bug-inducing invented data to replace your actual buggy data, we can only guess.
采纳的回答
Stephen23
2019-10-9
编辑:Stephen23
2019-10-9
This line will cause an error:
% ' '...
If you want to continue to the next line then you need to use an ellipsis, not %, i.e. this works for me:
... % ellipsis works!
The working file, which runs without error, is attached.
I still don't see the point in datestr('2019-09-04', 'yyyy-mm-dd'), which simply returns the character vector '2019-09-04', so you might as well just define that character vector directly.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Preprocessing 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!