746 total contributions since 2017

Knowledge means knowing where it is written...

Interested in:

- Optimization

- Mathematical Modelling

- Improvement of my programming skills

Answered

Use a structure as input in a function

Hi, try: % Define cylinder 1 cylinder(1).radius = 2; cylinder(1).height = 1.5; % Define cylinder 2 cylinder(2).radius = ...

Use a structure as input in a function

Hi, try: % Define cylinder 1 cylinder(1).radius = 2; cylinder(1).height = 1.5; % Define cylinder 2 cylinder(2).radius = ...

13 hours ago | 0

Answered

how to convert string to date?

Date = '10:12:25 Tue 11-Dec-18' res = datetime(Date ,'InputFormat','HH:mm:ss eee dd-MMM-yy','Format','dd/MM/yyyy HH:mm a') D...

how to convert string to date?

Date = '10:12:25 Tue 11-Dec-18' res = datetime(Date ,'InputFormat','HH:mm:ss eee dd-MMM-yy','Format','dd/MM/yyyy HH:mm a') D...

18 hours ago | 1

| accepted

Answered

How to find turning points using 'fsolve'

Hi, why not solve it symbolic: syms f(x,y) f(x,y) = x.^(2-x.^(0.5))+y.^(2-y.^(0.5)); [xsol,ysol] = vpasolve(diff(f,x) + dif...

How to find turning points using 'fsolve'

Hi, why not solve it symbolic: syms f(x,y) f(x,y) = x.^(2-x.^(0.5))+y.^(2-y.^(0.5)); [xsol,ysol] = vpasolve(diff(f,x) + dif...

1 day ago | 1

Answered

How to find the first entry of a sequence of values

Hi, try: result = A([1; find(diff(A(:,1))~=0)+1],:) gives the desired result: result = 5.0000 0 6.0000 ...

How to find the first entry of a sequence of values

Hi, try: result = A([1; find(diff(A(:,1))~=0)+1],:) gives the desired result: result = 5.0000 0 6.0000 ...

1 day ago | 1

| accepted

Answered

isqnonlin command: not enough input parameters error

Hi, try: % Sabit degerler k = 1.38e-23; % Boltzman sabiti q = 1.602e-19; % Elektronun yuku T = 25+273; % Si...

isqnonlin command: not enough input parameters error

Hi, try: % Sabit degerler k = 1.38e-23; % Boltzman sabiti q = 1.602e-19; % Elektronun yuku T = 25+273; % Si...

1 day ago | 0

Answered

Use Particle Swarm Optimization with inequality linear constraints.

Hi, there is not such a syntax, since PSO does not support constraints. If you need constraints i suggest to use ga, which is a...

Use Particle Swarm Optimization with inequality linear constraints.

Hi, there is not such a syntax, since PSO does not support constraints. If you need constraints i suggest to use ga, which is a...

3 days ago | 0

| accepted

Answered

How to average finite components only of 4 data?

Hi, the mean function has the option nanflag. That makes life easy: % create example data containing NaN values data1 = randi...

How to average finite components only of 4 data?

Hi, the mean function has the option nanflag. That makes life easy: % create example data containing NaN values data1 = randi...

3 days ago | 0

Answered

Saving models from classification learner App

Hi, you could consider to export a compact model without the training data - this will also work for making predictions on new ...

Saving models from classification learner App

Hi, you could consider to export a compact model without the training data - this will also work for making predictions on new ...

3 days ago | 0

| accepted

Answered

Is it possible to simplify symbolic expressions with known relations

Hi, use assume - like Star Strider suggested and additionally use simplify to get the desired result; syms x1 x2 assume(x1*x2...

Is it possible to simplify symbolic expressions with known relations

Hi, use assume - like Star Strider suggested and additionally use simplify to get the desired result; syms x1 x2 assume(x1*x2...

4 days ago | 1

Answered

Normalization of a vector

result = normalize(v,'range',[-1 1]) where v is your vector

Normalization of a vector

result = normalize(v,'range',[-1 1]) where v is your vector

4 days ago | 0

| accepted

Answered

Filling in a polygon

Hi, it depends on the order you enter the single points. See this: x8=[0, 2, 2.5, 3.5, 5, 4, 5, 3, 1, 1.5]; y8=[2, 2, 0, 2...

Filling in a polygon

Hi, it depends on the order you enter the single points. See this: x8=[0, 2, 2.5, 3.5, 5, 4, 5, 3, 1, 1.5]; y8=[2, 2, 0, 2...

5 days ago | 0

Answered

BVP4C code not giving an output & boundary condition issues.

Hi, your function does not return anything. Try: sol = main; subplot(2,1,1) plot(sol.x,sol.y) grid subplot(2,1,2) plot(so...

BVP4C code not giving an output & boundary condition issues.

Hi, your function does not return anything. Try: sol = main; subplot(2,1,1) plot(sol.x,sol.y) grid subplot(2,1,2) plot(so...

5 days ago | 0

Answered

None linear least square fit for complex model

Hi, have a read here: https://de.mathworks.com/help/releases/R2015a/curvefit/fit.html?searchHighlight=fit#bto2vuv-11 There is...

None linear least square fit for complex model

Hi, have a read here: https://de.mathworks.com/help/releases/R2015a/curvefit/fit.html?searchHighlight=fit#bto2vuv-11 There is...

5 days ago | 0

Answered

Plot error, vector must be same length

Hi, make t same size then the vectors you want to plot: % h = 0.08; nmax = 800; wx = zeros(1, nmax); wy = wx; wz = wx; t...

Plot error, vector must be same length

Hi, make t same size then the vectors you want to plot: % h = 0.08; nmax = 800; wx = zeros(1, nmax); wy = wx; wz = wx; t...

6 days ago | 1

| accepted

Answered

Is't possible to plot a one curve with two Y-axises for this case

Hi, just scale them: A=[0.5778 40.0000 152.8081 0.5867 41.0000 154.7064 0.5956 42.0000 156.5817 0.6045...

Is't possible to plot a one curve with two Y-axises for this case

Hi, just scale them: A=[0.5778 40.0000 152.8081 0.5867 41.0000 154.7064 0.5956 42.0000 156.5817 0.6045...

6 days ago | 0

Answered

How do i fix this error?

Hi, the Display option is only avaiable if the fitting method is nonlinear least squares: https://de.mathworks.com/help/curvef...

How do i fix this error?

Hi, the Display option is only avaiable if the fitting method is nonlinear least squares: https://de.mathworks.com/help/curvef...

6 days ago | 0

Answered

Unable to find explicit solution for "solve"

Hi, solve numeric: % Values for constants - I took some fantasy values... Isc = 0.1; Is = 1; q = 2; Rs = 0.0135; Rsh = -2...

Unable to find explicit solution for "solve"

Hi, solve numeric: % Values for constants - I took some fantasy values... Isc = 0.1; Is = 1; q = 2; Rs = 0.0135; Rsh = -2...

6 days ago | 0

| accepted

Answered

how can i a create a struct?

Hi, the best way to learn Matlab is reading the excellent documentation. Have a read here: https://de.mathworks.com/help/matla...

how can i a create a struct?

Hi, the best way to learn Matlab is reading the excellent documentation. Have a read here: https://de.mathworks.com/help/matla...

6 days ago | 0

| accepted

Answered

Produce an excel file with major and minor column name

https://de.mathworks.com/matlabcentral/answers/337613-how-to-merge-cells-in-excel

Produce an excel file with major and minor column name

https://de.mathworks.com/matlabcentral/answers/337613-how-to-merge-cells-in-excel

7 days ago | 0

Answered

"the scope of variable spans multiple functions matlab"

Hi, yes, it is due to the nested functions. It is one possible way to avoid global variables. There is nothing wrong with it. T...

"the scope of variable spans multiple functions matlab"

Hi, yes, it is due to the nested functions. It is one possible way to avoid global variables. There is nothing wrong with it. T...

7 days ago | 1

| accepted

Answered

Average of two closed curves

Hi, try: % Calculate Parts to 90° angle1 = linspace(0,pi/4,180)'; % Radius of circle = length of square = 1 r = 1; % Calcu...

Average of two closed curves

Hi, try: % Calculate Parts to 90° angle1 = linspace(0,pi/4,180)'; % Radius of circle = length of square = 1 r = 1; % Calcu...

7 days ago | 3

Answered

Error when using ezplot

syms a(x,y) a = x^3 + y^3 - 3*x*y == 0; ezplot(lhs(a),[-2, 2, -3, 2])

Error when using ezplot

syms a(x,y) a = x^3 + y^3 - 3*x*y == 0; ezplot(lhs(a),[-2, 2, -3, 2])

7 days ago | 0

| accepted

Answered

Help me with indexing please?

Hi, as suggested in the comments read the documentation. Here is a small example which is near by your problem. Try to understa...

Help me with indexing please?

Hi, as suggested in the comments read the documentation. Here is a small example which is near by your problem. Try to understa...

7 days ago | 0

| accepted

Answered

Finite Elements Method creating global stiffness matrix

Hi, you overwrite k every time. Im sure it could be done much easier - but here s a quick solution without any code optimizatio...

Finite Elements Method creating global stiffness matrix

Hi, you overwrite k every time. Im sure it could be done much easier - but here s a quick solution without any code optimizatio...

7 days ago | 0

| accepted

Answered

distance between two points

dist = sqrt((A(:,1)-B(:,1)).^2 + (A(:,2)-B(:,2)).^2 + (A(:,3)-B(:,3)).^2);

distance between two points

dist = sqrt((A(:,1)-B(:,1)).^2 + (A(:,2)-B(:,2)).^2 + (A(:,3)-B(:,3)).^2);

8 days ago | 0

| accepted

Answered

sound generation using MATLAB

Hi, think about your sampling frequency. Can it really work to sample a signal of 100kHz with a sample rate of 24kHz? Or do you...

sound generation using MATLAB

Hi, think about your sampling frequency. Can it really work to sample a signal of 100kHz with a sample rate of 24kHz? Or do you...

9 days ago | 1

Answered

Importing .csv files and generating surf plots for each

Hi, have a read here: https://de.mathworks.com/help/matlab/ref/uigetfile.html#mw_8fd45c03-ae42-4f5a-9595-297c77185283 This ex...

Importing .csv files and generating surf plots for each

Hi, have a read here: https://de.mathworks.com/help/matlab/ref/uigetfile.html#mw_8fd45c03-ae42-4f5a-9595-297c77185283 This ex...

9 days ago | 0

Answered

Resonance frequency in enclosures

Hi, you can use this function: function Frequencia_Table = Frequencia(v,lx,ly,lz) % Building the array of values nx = [zeros...

Resonance frequency in enclosures

Hi, you can use this function: function Frequencia_Table = Frequencia(v,lx,ly,lz) % Building the array of values nx = [zeros...

9 days ago | 1

| accepted

Answered

GWO structure help, please rewrite the code help

NumAgents = 7; maxiters = 2000; lb = [0 2]; ub = [1 5]; dim = 2; fobj = @my_function_that_expects_a_vector_of_2_values; ...

GWO structure help, please rewrite the code help

NumAgents = 7; maxiters = 2000; lb = [0 2]; ub = [1 5]; dim = 2; fobj = @my_function_that_expects_a_vector_of_2_values; ...

9 days ago | 0

Answered

Error using sym/subs Too many input arguments. Error in mx_model (line 176) f = subs(f, cup,cu,0);

Hi, as the error message says, there are too much input arguments. The correct syntax for subs is: subs(eqn,old,new) The code...

Error using sym/subs Too many input arguments. Error in mx_model (line 176) f = subs(f, cup,cu,0);

Hi, as the error message says, there are too much input arguments. The correct syntax for subs is: subs(eqn,old,new) The code...

10 days ago | 0