Réponse apportée
error statement is not inside anny function
Any functions defined in a script must be at the end of the script. Also, the function monteCarloSimulation_withProjection is d...

presque 3 ans il y a | 0

Réponse apportée
hold on/off for loglog axes
You can use colororder paired with RGB Triplets - x = logspace(-1,2); y1 = 10.^x; y2 = 1./10.^x; y3 = 1.^x; figure log...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
Why is this loop faster than a vectorised version? Could the vectorised version be made faster than the loop?
Ideally, timeit should be used over tic-toc to get a more accurate idea of run times of the codes. tic-toc is generally used for...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
Not enough input arguments ode45
I am not sure how the different symbolic variables and expressions come into play here for solving the ODE. Nonetheless, Any fu...

presque 3 ans il y a | 0

Réponse apportée
Find the amount of graph intersections
You can utilize this FEX Submission - https://in.mathworks.com/matlabcentral/fileexchange/22441-curve-intersections?s_tid=ta_fx_...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
Drawing line chart in EXCEL from Matlab and bridging the missing values(NaN)
You can interpolate the missing data via fillmissing and then plot - data = readmatrix('filename.extension'); %Linear inter...

presque 3 ans il y a | 0

Réponse apportée
Check if the multiple 1x2 arrays contained within a 4x2 array exist within a larger 10x2 array
a1 = [1, 5, 4, 3; 3, 4, 7, 1] b1 = [5,4,1,3,7,1,9,5,8,3; 4,7,3,1,5,6,3,9,5,3] [out, idx] = ismember(a1.', b1.', 'rows')

presque 3 ans il y a | 1

Réponse apportée
How to create a complex transfer function?
You need to provide the multiplication operator. And close the parenthesis properly. Computers don't understand that two param...

presque 3 ans il y a | 1

| A accepté

Réponse apportée
piecewise function and function handles
You need to define multiple conditions separately/individually i.e - This (0<= wave_angle <= pi-E_2rad) should be - (wav...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
Multiple Lines in a Stacked Plot
If you are working with R2018b or a later version, check out stackedplot %Random data n = 10; t = (1:n).'; a = zeros(n,1); ...

presque 3 ans il y a | 1

| A accepté

Réponse apportée
How would I plot this and then achieve minimum and maximum.
Look into Array vs Matrix Operations max, min - for global extremum islocalmax, islocalmin - for local extremum

presque 3 ans il y a | 0

Réponse apportée
'tabulate' function
tabulate is a part of the Statistics and Machine Learning Toolbox. To access the function, you need to download and install the ...

presque 3 ans il y a | 1

| A accepté

Réponse apportée
How to concatenate the data in each iteration in the same variable?
Firstly, you don't need to use find(), logical indexing is going to be faster. As for storing the data, You can preallocate a c...

presque 3 ans il y a | 0

Réponse apportée
如何使此程序正常运行?
As the error states, The function interp1() expects the length of the first input to be equal to the number of rows in the secon...

presque 3 ans il y a | 1

| A accepté

Réponse apportée
Is there any possible to save the logical image in png?
The variable mask() is already a logical array. You don't need to convert it to logical(). Just write it as a PNG image - fon...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
delete the third dimension in 4D matrix
You are not accessing the data stored in the struct properly. You need to use the fieldname of the corresponding data to access ...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
Can someone check whether my script is correct or not? I did this using the same method as the one last time.
There was a missing element-wise operator in the sin() in the definition of 'k'. Also, I have modified the legend to show the e...

presque 3 ans il y a | 1

| A accepté

Réponse apportée
find element egual to substring in array string
From what I understood of the given information - %Input c=["A1_asd";"A2_rrd";"A_dj";"B1_gre";"B2_rffe";"B3_rffe"] %Output...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
Why am I getting this error?
There is a missing operator between Ra and (2*L-x) in the else statement block - Update the code accordingly. %% vvv...

presque 3 ans il y a | 0

Réponse apportée
double integration of function handles with two different variables
You need to use element-wise operations to define the integrand - From the documentation of integral2, the definition of the 1...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
Help With for loop with tranfer function and step
There is no field in the struct 'S' with name 'T'. Thus you get the error in the line you defined 'S'. I suspect that you want ...

presque 3 ans il y a | 1

Réponse apportée
I'm calculating using the order 3 polynomial interpolation method. But why does an array appear?
The syntax for defining an anonymouts function is incorrect in your code. Also, you are trying to take logarithm of 0, which do...

presque 3 ans il y a | 0

Réponse apportée
I am trying to plot a series, with multiple variables.
Firstly - To use "n" as a symbolic variable, you will have to define it as a symbolic variable. Secondly, you have mentioned to...

presque 3 ans il y a | 0

Réponse apportée
Can you answer why am I getting this error. What should Ido? The error says 'Unrecognised variable z'.
"Can you answer why am I getting this error." Because "z" has not been defined. Two things - Firstly, you are assuming that ...

presque 3 ans il y a | 0

Réponse apportée
Derivative not working plot
Because x_q is empty, thus q is also empty. And plotting empty arrays leads to empty figures. a = -2.914e-07; b = 0.002246; c...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
Revolve a Plot around y axis to generate a 3D plot
%2D Data n = 100; theta = linspace(-pi/2,pi/2,n); a=.75; b=.25; X=a*cos(theta); Y=b*sin(theta); %plot the 2D curve fig...

presque 3 ans il y a | 0

Réponse apportée
Indexing with min and numel
[n,I] = min([numel(vector1),numel(vector2)]) There are 2 elements in the input array, as numel() returns a scalar value. Then ...

presque 3 ans il y a | 2

| A accepté

Réponse apportée
How to efficiently calculate a weighted sum of 3 dimensional matrix through a vector in matlab
%Random data A = rand(3,4,5); b = rand(5,1); C = sum(A.*reshape(b,1,1,[]), 3)

presque 3 ans il y a | 0

Réponse apportée
Matlab function assumed inputs
Yes, use varargin with nargin - [x1,y1] = pricingprogramme(5,10) [x2,y2] = pricingprogramme(1,2,3,4) function [x,y] = pricin...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
How manage for loop to calculate distances?
As the goal here is to find the distance between consecutive points - %Data lat= [-8, -8.2, -8.21, -8.34, -8.9]; long = [-18...

presque 3 ans il y a | 0

| A accepté

Charger plus