Find the difference between two numbers in an array and create a new array
16 views (last 30 days)
Show older comments
Hello, I am working on a meteoroogy project to calculate mean periods of buoyancy oscillation. Rather than do everything by hand, I figured it would be easier to throw them in matlab and have it calculate it. Right now, I'm at a point where I have calculated theta values in an array (11,1). For the equation I am using, I need to find the difference between theta values in order to use that number for my equation. (g/theta * differnece in Theta/difference in height)
All of these are in their own arrays. At this point, I need help figureing out what commands to use to have it figure out the difference between each of the theta values (and height, but I'm assuming I will end up just using the same code). I have attached the working code I have used to get each value so far.
One thing that can throw a wrench into my plans... there are two data sets that I have combined into one with a blank box in between them in order to split them apart. So I'll have to account for that, which will be a problem on its own. Thank you for your help!
Table = readtable('file.xlsx');
pres = Table(: , 1);
hght = Table(: , 2);
temp = Table(: , 3);
dwpt = Table(: , 4);
rh = Table(: , 5);
mixr = Table(: , 6);
Rdcpdry = .286;
thing = Rdcpdry;
tp1 = (1000 ./ pres{: , 1}) .^thing;
theta = (temp{: , 1}) .* tp1;
0 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!