Answered

How to prevent decrement (melting) past 0 until growth increases again?

As soon as you estimated hsnow, force all/any negative values to 0 hsnow(hsnow<0)=0;

How to prevent decrement (melting) past 0 until growth increases again?

As soon as you estimated hsnow, force all/any negative values to 0 hsnow(hsnow<0)=0;

4 mois ago | 0

Answered

Plotting Velocity p m m m

This is a boundary value problem. You need to have the initial and boundary conditions to develop the velocity field required fo...

Plotting Velocity p m m m

This is a boundary value problem. You need to have the initial and boundary conditions to develop the velocity field required fo...

4 mois ago | 1

| accepted

Answered

How to make binary file for each iteration in a loop?

I think, instead of the code creating "only the last file", it is overwritting the same file, so you end up with only one file. ...

How to make binary file for each iteration in a loop?

I think, instead of the code creating "only the last file", it is overwritting the same file, so you end up with only one file. ...

4 mois ago | 0

Answered

Plotting the average line of a graph of a column imported from an excel

Not sure, where you are getting the error. I tried this % some random numbers x=rand(15808,1); % get the average by usi...

Plotting the average line of a graph of a column imported from an excel

Not sure, where you are getting the error. I tried this % some random numbers x=rand(15808,1); % get the average by usi...

4 mois ago | 1

| accepted

Answered

Calculate volume of cylindric tank

Try this: function [tank_volume mA_points fuel_level mA_reading] = get_tank_volume(tank_diameter, tank_length, sensor_read) % ...

Calculate volume of cylindric tank

Try this: function [tank_volume mA_points fuel_level mA_reading] = get_tank_volume(tank_diameter, tank_length, sensor_read) % ...

4 mois ago | 0

| accepted

Answered

Location of the "end" statement of the main function in a m. file?

If you have 'end' at the end of a file, then your functions become 'Nested functions'. The variables created inside the function...

Location of the "end" statement of the main function in a m. file?

If you have 'end' at the end of a file, then your functions become 'Nested functions'. The variables created inside the function...

4 mois ago | 1

Solved

Who Has the Most Change?

You have a matrix for which each row is a person and the columns represent the number of quarters, nickels, dimes, and pennies t...

4 mois ago

Solved

Free passes for everyone!

_Simply return the name of the coolest numerical computation software ever_ *Extra reward* (get a _freepass_): Once a mont...

4 mois ago

Solved

Area of an equilateral triangle

Calculate the area of an equilateral triangle of side x. <<https://i.imgur.com/jlZDHhq.png>> Image courtesy of <http://up...

4 mois ago

Solved

Length of a short side

Calculate the length of the short side, a, of a right-angled triangle with hypotenuse of length c, and other short side of lengt...

4 mois ago

Solved

Side of an equilateral triangle

If an equilateral triangle has area A, then what is the length of each of its sides, x? <<https://i.imgur.com/jlZDHhq.png>> ...

4 mois ago

Solved

Bottles of beer

Given an input number representing the number of bottles of beer on the wall, output how many are left if you take one down and ...

4 mois ago

Solved

Distance walked 1D

Suppose you go from position 7 to 10 to 6 to 4. Then you have walked 9 units of distance, since 7 to 10 is 3 units, 10 to 6 is 4...

4 mois ago

Solved

Is this triangle right-angled?

Given any three positive numbers a, b, c, return true if the triangle with sides a, b and c is right-angled. Otherwise, return f...

4 mois ago

Answered

Output a video in MATLAB

Try this video = VideoWriter('Helix.avi','Uncompressed AVI'); open(video); h=figure(1); hold on; for t = 2:100001 % ...

Output a video in MATLAB

Try this video = VideoWriter('Helix.avi','Uncompressed AVI'); open(video); h=figure(1); hold on; for t = 2:100001 % ...

4 mois ago | 0

Answered

Data extraction and indexing of array

If your data size changes throughout the structure then load them into a cell array and access each entry. nid = 5; xposdata =...

Data extraction and indexing of array

If your data size changes throughout the structure then load them into a cell array and access each entry. nid = 5; xposdata =...

4 mois ago | 0

| accepted

Answered

Plotting a graph through the points

You mean fitting a curve or polynomial function through the points? Read: polyfit and you can modify the examples given there ...

Plotting a graph through the points

You mean fitting a curve or polynomial function through the points? Read: polyfit and you can modify the examples given there ...

4 mois ago | 0

Answered

Saving an imagesc file as .png without the white borders?

Try: print(I,filename,'-dpng'); By white border if you mean the background outside the figure, then you would have to export ...

Saving an imagesc file as .png without the white borders?

Try: print(I,filename,'-dpng'); By white border if you mean the background outside the figure, then you would have to export ...

4 mois ago | 0

Answered

About copying txt to matrix

Try this: https://www.mathworks.com/help/matlab/ref/fscanf.html Look at the examples given there you should be able to do it i...

About copying txt to matrix

Try this: https://www.mathworks.com/help/matlab/ref/fscanf.html Look at the examples given there you should be able to do it i...

4 mois ago | 0

Answered

Sizing array to add to a 3D array

You are changing the array size which is not how you do to store something. You are trying to store multi-dimensional array in a...

Sizing array to add to a 3D array

You are changing the array size which is not how you do to store something. You are trying to store multi-dimensional array in a...

4 mois ago | 0

| accepted

Answered

Expression representation in an Iteration

Something like this ? w_k(nx) = 0; w_k_n(n_iter) = 0; for i=1:nx w_k_n(1) = w_k(i); for j=1:n_iter ...

Expression representation in an Iteration

Something like this ? w_k(nx) = 0; w_k_n(n_iter) = 0; for i=1:nx w_k_n(1) = w_k(i); for j=1:n_iter ...

4 mois ago | 0

Answered

Identify first and last indicies of numbers in an array containing NaN's

Try this: % Instead of diff, just loop through the indices to see the order and group them your_nan_indices = [2, 3, 4, 5, 9...

Identify first and last indicies of numbers in an array containing NaN's

Try this: % Instead of diff, just loop through the indices to see the order and group them your_nan_indices = [2, 3, 4, 5, 9...

4 mois ago | 0

Answered

Plotting a field from a struct inside a struct

Try this: nBlobs = numel(BB); h = figure; clf; hold on; for i = 1:nBlobs x = i; temp = BB(i).blob; temp_s...

Plotting a field from a struct inside a struct

Try this: nBlobs = numel(BB); h = figure; clf; hold on; for i = 1:nBlobs x = i; temp = BB(i).blob; temp_s...

4 mois ago | 1

| accepted

Answered

Replace values in grid data (3D) to NaN, like another (3D) have NaN

I don't know if I understood your question properly, but here goes: If you have NaN values in SST matrix and would like to repl...

Replace values in grid data (3D) to NaN, like another (3D) have NaN

I don't know if I understood your question properly, but here goes: If you have NaN values in SST matrix and would like to repl...

4 mois ago | 1

Answered

Help storing values for Ma and Cd so I can create a plot for them.

The problem is inside the for loop. Change this V = sqrt((Vx(n-1))^2 + (Vy(n-1))^2); %V = velocity [ft/s] Ma = V/c; % Ma num...

Help storing values for Ma and Cd so I can create a plot for them.

The problem is inside the for loop. Change this V = sqrt((Vx(n-1))^2 + (Vy(n-1))^2); %V = velocity [ft/s] Ma = V/c; % Ma num...

4 mois ago | 0

Solved

Calculate the Number of Sign Changes in a Row Vector (No Element Is Zero)

For a row vector: V=[7 1 2 -3] there is one sign change (from 2 to -3). So, the function you write must return N=1. F...

4 mois ago

Solved

Symmetry of vector

Determine whether the vector is symmetric or not (vector could be even or odd in length). For example: x = [1 2 3 3 2 1] ...

4 mois ago

Solved

Create an n-by-n null matrix and fill with ones certain positions

The positions will be indicated by a z-by-2 matrix. Each row in this z-by-2 matrix will have the row and column in which a 1 has...

4 mois ago

Answered

Averaging subsets of a large dataset

It can be achieved by getting the indices of unique values for the latitude and longitude once you sort the matrix based on them...

Averaging subsets of a large dataset

It can be achieved by getting the indices of unique values for the latitude and longitude once you sort the matrix based on them...

4 mois ago | 1

Answered

Different Scales on same plot

May be give this a try: z=1:2:100; y=log(z); % Dummy log profile h=figure(1); h.Color=[1 1 1]; subplot(1,5,1) p1...

Different Scales on same plot

May be give this a try: z=1:2:100; y=log(z); % Dummy log profile h=figure(1); h.Color=[1 1 1]; subplot(1,5,1) p1...

4 mois ago | 1

| accepted