Info

This question is closed. Reopen it to edit or answer.

Dimension mismatch due to unknown Script loop?

1 view (last 30 days)
xenon99942
xenon99942 on 27 Apr 2017
Closed: MATLAB Answer Bot on 20 Aug 2021
Hi!
tawes_new(:,1) = tawes.data(:,1); %temp. time array
tawes_new(:,2) = tawes.data(:,4); %temp. rain rate array [mm/min]
tawes_new(:,3) = tawes.data(:,12); %global radiation [W/m^2]
tawes_new(:,4) = tawes.data(:,14); %foehn index
tawes_new(:,5) = tawes.data(:,6); %hz wind speed m/s
tawes_new(:,6) = tawes.data(:,2); %Temperature in °C
tawes_new(isnan(tawes_new(:,2)),:)=[]; %delete NaNs from data in a row that indices are equal later on
tawes_new(isnan(tawes_new(:,3)),:)=[];
tawes_new(isnan(tawes_new(:,4)),:)=[];
tawes_new(isnan(tawes_new(:,5)),:)=[];
tawes_new(isnan(tawes_new(:,6)),:)=[];
The error occurse for line 1. tawes.data(:,1) is a sized m X 1 array. Later in my script i am uniformily deleting not-needed indices from the copy array tawes_new(:,1) of tawes.data(:,1) (and others). So i will work with the modified copy tawes_new(:,1) instead of the original data. but why is the error occuring? it would be only an error if the script would be kind of a loop and starts from the beginning again. than the "=" assignement would be incorrect , of course.
  1 Comment
Adam
Adam on 27 Apr 2017
'Dimension mismatch due to unknown Script loop' is not an error message I am familiar with. What is the actual message? (I'm assuming that is just your interpretation of the message.
If you run your script more than once though remember that everything will be left over in the workspace from the previous run. This is why functions are far better than scripts in general (well, one of the reasons, at least).

Answers (0)

This question is closed.

Community Treasure Hunt

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

Start Hunting!