reshaping data properly mesh grid
Ältere Kommentare anzeigen
Hi all,
so I have the follwoing problem. I have data stored in a (2000,4) mattrix where the last colum represents the predictions I drew from a logistic regression. Now, I managed to put in a messhgrid data on columns 2 and 3 (first term is the constant) as height and weeightt as follows:
h = min(X(:,1)):.01:max(X(:,1)); %(1,2069)
w = min(X(:,2)):1:max(X(:,2)); %(1,24)
[hx, wx] = meshgrid(h,w); %(24,2069)
but did not manage to put in the same form the predictions since I computed in a later step. Predictions are a (2000,1) vector.
The aim basically is to make this:
pred = reshape(pred, size(hx));
work without the error:
Error using reshape
Number of elements must not change. Use [] as one of the size inputs to automatically calculate the appropriate size
for that dimension.
which, if I have undestood the issue is solved if I manage to put pred in a vector of size "size(hx, 1) * size(hx, 2)".
Can you pleasse help m out on this?
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Descriptive Statistics finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!