Answered

My Matlab take so long to start on AWS

There are a number of startup options. For example, using -nosplash will prevent that particular image from displaying. A good s...

My Matlab take so long to start on AWS

There are a number of startup options. For example, using -nosplash will prevent that particular image from displaying. A good s...

20 giorni ago | 0

Answered

Why do I get more error bars than I defined?

For most of your points, you are not plotting no error bar; you are plotting an error bar with zero error. You could make the d...

Why do I get more error bars than I defined?

For most of your points, you are not plotting no error bar; you are plotting an error bar with zero error. You could make the d...

20 giorni ago | 0

| accepted

Answered

I am trying to work out a volume given input values but it says theres an error ''Index must not exceed 1''?

This expression: NumberOfFloors(WidthOfFloors*LengthOfFloors*HeightOfFloors) is trying to index into the variable NumberOfFloo...

I am trying to work out a volume given input values but it says theres an error ''Index must not exceed 1''?

This expression: NumberOfFloors(WidthOfFloors*LengthOfFloors*HeightOfFloors) is trying to index into the variable NumberOfFloo...

24 giorni ago | 1

| accepted

Answered

Dark Mode editor for MATLAB

UPDATE April 2022 - Please see this Answer for more details on dark mode: https://www.mathworks.com/matlabcentral/answers/167119...

Dark Mode editor for MATLAB

UPDATE April 2022 - Please see this Answer for more details on dark mode: https://www.mathworks.com/matlabcentral/answers/167119...

24 giorni ago | 14

| accepted

Answered

Why isn't sum of logs == log of product?

They are equal to within double precision: log(3) + log(4) - log(3*4) There are many places on this forum that discuss this in...

Why isn't sum of logs == log of product?

They are equal to within double precision: log(3) + log(4) - log(3*4) There are many places on this forum that discuss this in...

24 giorni ago | 0

Answered

How to delete the first or the first two characters in a string?

In modern MATLAB parlance, 'W987' is a character array, not a string. @KSSV's answer is accurate in your case, but will not wor...

How to delete the first or the first two characters in a string?

In modern MATLAB parlance, 'W987' is a character array, not a string. @KSSV's answer is accurate in your case, but will not wor...

29 giorni ago | 0

Answered

How can I store the corresponding temperatures (T), specific volumes (v), and entropies (s) of a thermodynamics superheated table in MATLAB arrays.

I recommend using Tabula to extract the data from the PDF file into a text file or spreadsheet. Then there are a few ways to pu...

How can I store the corresponding temperatures (T), specific volumes (v), and entropies (s) of a thermodynamics superheated table in MATLAB arrays.

I recommend using Tabula to extract the data from the PDF file into a text file or spreadsheet. Then there are a few ways to pu...

circa un mese ago | 0

Answered

How to combine two matrix based on position and find the corresponding element?

c = b(a)

How to combine two matrix based on position and find the corresponding element?

c = b(a)

circa un mese ago | 0

| accepted

Answered

Remove space in a string while parting data using sscanf.

Here is a radically different approach, using regexp instead of sscanf: tline = "Pressure Offsets: -0.206 ,-0.025,0.004 ,-0.0...

Remove space in a string while parting data using sscanf.

Here is a radically different approach, using regexp instead of sscanf: tline = "Pressure Offsets: -0.206 ,-0.025,0.004 ,-0.0...

circa un mese ago | 0

| accepted

Answered

''Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 1-by-100'' error when updating my vector W

The way you have defined F1 = @(t,r)X; the result of this line W1 = F1(t(i),y(i)); is going to be W1 = zeros(1,100); Note t...

''Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 1-by-100'' error when updating my vector W

The way you have defined F1 = @(t,r)X; the result of this line W1 = F1(t(i),y(i)); is going to be W1 = zeros(1,100); Note t...

circa un mese ago | 0

| accepted

Answered

How to plot a graph with y-axis values that can be incremental?

In order to get a plot that looks like the blue line, you would need y data that gradually increases, levels off, then decreases...

How to plot a graph with y-axis values that can be incremental?

In order to get a plot that looks like the blue line, you would need y data that gradually increases, levels off, then decreases...

circa un mese ago | 0

Answered

Make subplot 'stick' to each other

It might be easier to do what you want with the newer tiledlayout command for making subplots.

Make subplot 'stick' to each other

It might be easier to do what you want with the newer tiledlayout command for making subplots.

circa un mese ago | 0

Answered

Index exceeds the number of array elements.

There are a couple issues with your code. First, MATLAB's algorithm to automatically detect the file delimiter seems to have got...

Index exceeds the number of array elements.

There are a couple issues with your code. First, MATLAB's algorithm to automatically detect the file delimiter seems to have got...

circa un mese ago | 0

Answered

How to implement this random distribution operation with matlab（beta disturbution）

You can calculate the parameters of the beta distribution from the mean and variance. The formula for doing this is on the Wikip...

How to implement this random distribution operation with matlab（beta disturbution）

You can calculate the parameters of the beta distribution from the mean and variance. The formula for doing this is on the Wikip...

circa un mese ago | 0

Answered

Gaussian Fitting under peaks

If you have the underlying data the fitgmdist function in the Statistics and Machine Learning Toolbox does this sort of fit. Her...

Gaussian Fitting under peaks

If you have the underlying data the fitgmdist function in the Statistics and Machine Learning Toolbox does this sort of fit. Her...

circa un mese ago | 1

Answered

Hi. I want to create a random spatially correlated Gausiian 3D field. How to do that in Matlab?

It seems that this File Exchange submission might be helpful. It looks like it is 2D only, but perhaps you could adapt it?

Hi. I want to create a random spatially correlated Gausiian 3D field. How to do that in Matlab?

It seems that this File Exchange submission might be helpful. It looks like it is 2D only, but perhaps you could adapt it?

circa un mese ago | 0

Answered

How to extract NaN values from matrix?

Here are two different ways: M = [2 3; 5 NaN]; Mvec = M(not(isnan(M)))' Mvec2 = M; Mvec2(isnan(Mvec2)) = []

How to extract NaN values from matrix?

Here are two different ways: M = [2 3; 5 NaN]; Mvec = M(not(isnan(M)))' Mvec2 = M; Mvec2(isnan(Mvec2)) = []

circa un mese ago | 0

| accepted

Answered

How to plot variables with different array sizes?

Here is one way: figure hold on plot(t1,Y1) plot(t2,Y2) plot(t3,Y3) Another is: figure plot(t1,Y1,t2,Y2,t3,Y3) See the ...

How to plot variables with different array sizes?

Here is one way: figure hold on plot(t1,Y1) plot(t2,Y2) plot(t3,Y3) Another is: figure plot(t1,Y1,t2,Y2,t3,Y3) See the ...

circa un mese ago | 1

Answered

Imput a date without getting a nan

DateStrings = {'2021-05-26';'2021-08-03'}; t = datetime(DateStrings,'InputFormat','yyyy-MM-dd'); waveHeight = [2 3]; figure ...

Imput a date without getting a nan

DateStrings = {'2021-05-26';'2021-08-03'}; t = datetime(DateStrings,'InputFormat','yyyy-MM-dd'); waveHeight = [2 3]; figure ...

circa un mese ago | 1

Answered

How to Cite Matlab 2022

According to Cite Bay (which I cannot directly vouch for), the citation style should be MATLAB. (2022). Version R2022a. Natick,...

How to Cite Matlab 2022

According to Cite Bay (which I cannot directly vouch for), the citation style should be MATLAB. (2022). Version R2022a. Natick,...

circa 2 mesi ago | 0

| accepted

Answered

Function not giving an output

This condition almost certainly does not do what you expect: (pt == (1 || 2) && (size(time) == 4)) The problem here is (at lea...

Function not giving an output

This condition almost certainly does not do what you expect: (pt == (1 || 2) && (size(time) == 4)) The problem here is (at lea...

circa 2 mesi ago | 0

Answered

when i plot a function, others disappear

All three lines are being plotted. The issue is that the green line goes to huge values, so you don't see the separation between...

when i plot a function, others disappear

All three lines are being plotted. The issue is that the green line goes to huge values, so you don't see the separation between...

circa 2 mesi ago | 1

Answered

resize a matrix and missed data "zero"

Here is one way: M = [ 1 2 5; 80 50 60]; Mrange = M(1,1):M(1,end); Mexpanded = [Mrange; zeros(1,M(1,end))]; Mexp...

resize a matrix and missed data "zero"

Here is one way: M = [ 1 2 5; 80 50 60]; Mrange = M(1,1):M(1,end); Mexpanded = [Mrange; zeros(1,M(1,end))]; Mexp...

circa 2 mesi ago | 0

Answered

Goal: Create a graph with 95% confidence intervals. Issue using patch.

It's unclear to me why you are doing the str2double and cell array manipulations on yCI95, but it works if you fix that up: x =...

Goal: Create a graph with 95% confidence intervals. Issue using patch.

It's unclear to me why you are doing the str2double and cell array manipulations on yCI95, but it works if you fix that up: x =...

circa 2 mesi ago | 0

Answered

Calculating returns of a table structure and error operator '-' is not supported for operands of type 'table'.

You don't need to transform to a different variable class, but you need to use different syntax to access the contents of a tabl...

Calculating returns of a table structure and error operator '-' is not supported for operands of type 'table'.

You don't need to transform to a different variable class, but you need to use different syntax to access the contents of a tabl...

circa 2 mesi ago | 1

Answered

3D plot using only data points, not a function

There are several options, for example mesh surf scatter3 Perhaps take a look at the MATLAB Gallery for something close to w...

3D plot using only data points, not a function

There are several options, for example mesh surf scatter3 Perhaps take a look at the MATLAB Gallery for something close to w...

circa 2 mesi ago | 0

Answered

How do you host a web app to be publicly available and not rely local computer?

One solution is to run MATLAB on a cloud-based service such as AWS. Another possibility is to use the MATLAB Compiler to genera...

How do you host a web app to be publicly available and not rely local computer?

One solution is to run MATLAB on a cloud-based service such as AWS. Another possibility is to use the MATLAB Compiler to genera...

circa 2 mesi ago | 1

| accepted

Answered

Legend colors match with plot

Here is one way to code this (assuming I understand what you meant): rng default N = 3; P=[0.35 0.25 0.2 0.15 0.10]; nElemMa...

Legend colors match with plot

Here is one way to code this (assuming I understand what you meant): rng default N = 3; P=[0.35 0.25 0.2 0.15 0.10]; nElemMa...

circa 2 mesi ago | 0

| accepted

Answered

I want to convert a single cell to a float number

I'm confused. The way you have defined celltest, the first element is already a (double-precision) floating-point number: cellt...

I want to convert a single cell to a float number

I'm confused. The way you have defined celltest, the first element is already a (double-precision) floating-point number: cellt...

circa 2 mesi ago | 0

Answered

Matrix calculation(replacing a new value instead of matrix element)

The code is doing what you expect, but the format of the output obscures the result. Try using format long, and you'll see the r...

Matrix calculation(replacing a new value instead of matrix element)

The code is doing what you expect, but the format of the output obscures the result. Try using format long, and you'll see the r...

circa 2 mesi ago | 1

| accepted