Iteration (Column times Column)

Hi, I have sample data that have four columns which is Latitude, Longitude, U component and V Component
Capture.PNG
I want to compute the absolute wind speed by referring to this coding
f = 'uvcomponent.txt';
lat= f(:,1);
lon= f(:,2);
u = f(:,3);
v = f(:,4);
interval=0.25;
%set area limit
minlat=0+ (interval);
maxlat=14- (interval);
minlon=95 + (interval);
maxlon=126 - (interval);
i1=minlat:interval:maxlat;
j=minlon:interval:maxlon;
%calculate the absolute wind speed
ws=sqrt((u^2)+(v^2))
Thus, I need some advice on how to perform this coding.

1 Comment

ws = sqrt((u.^2)+(v.^2))
^ ^
To use MATLAB you must learn the difference between matrix and array operations.

This question is closed.

Tags

Asked:

zzm
on 21 Feb 2019

Closed:

on 20 Aug 2021

Community Treasure Hunt

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

Start Hunting!