Beantwortet
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...

mehr als 2 Jahre vor | 0

Beantwortet
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...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
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...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
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...

mehr als 2 Jahre vor | 0

Beantwortet
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_...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
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...

mehr als 2 Jahre vor | 0

Beantwortet
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')

mehr als 2 Jahre vor | 1

Beantwortet
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...

mehr als 2 Jahre vor | 1

| akzeptiert

Beantwortet
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...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
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); ...

mehr als 2 Jahre vor | 1

| akzeptiert

Beantwortet
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

mehr als 2 Jahre vor | 0

Beantwortet
'tabulate' function
tabulate is a part of the Statistics and Machine Learning Toolbox. To access the function, you need to download and install the ...

mehr als 2 Jahre vor | 1

| akzeptiert

Beantwortet
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...

mehr als 2 Jahre vor | 0

Beantwortet
如何使此程序正常运行?
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...

mehr als 2 Jahre vor | 1

| akzeptiert

Beantwortet
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...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
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 ...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
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...

mehr als 2 Jahre vor | 1

| akzeptiert

Beantwortet
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...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
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...

mehr als 2 Jahre vor | 0

Beantwortet
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...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
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 ...

mehr als 2 Jahre vor | 1

Beantwortet
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...

mehr als 2 Jahre vor | 0

Beantwortet
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...

mehr als 2 Jahre vor | 0

Beantwortet
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 ...

mehr als 2 Jahre vor | 0

Beantwortet
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...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
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...

mehr als 2 Jahre vor | 0

Beantwortet
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 ...

mehr als 2 Jahre vor | 2

| akzeptiert

Beantwortet
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)

mehr als 2 Jahre vor | 0

Beantwortet
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...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
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...

mehr als 2 Jahre vor | 0

| akzeptiert

Mehr laden