310 total contributions since 2017

Knowledge means knowing where it is written...

Interested in:

- Optimization

- Mathematical Modelling

- Improvement of my programming skills

Answered

Generate a 2-dimensional array with random numbers

Hi, does this help: n = 100; % number of random numbers A = zeros(n,2); A(:,1)= randi(996,n,1)+4; A(:,2)= randi...

Generate a 2-dimensional array with random numbers

Hi, does this help: n = 100; % number of random numbers A = zeros(n,2); A(:,1)= randi(996,n,1)+4; A(:,2)= randi...

2 hours ago | 1

| accepted

Answered

plz help me to understand those cod of lines

Hi, [~, candidates_idx] = sort(candidates); gives indices for the sorted elements of the array _candidats_. For example ...

plz help me to understand those cod of lines

Hi, [~, candidates_idx] = sort(candidates); gives indices for the sorted elements of the array _candidats_. For example ...

9 hours ago | 0

| accepted

Answered

How to expand a Matrix ?

Hi, this would work i think: A = [1 2 3; 4 5 6] n = 3 % Number of repeated values --> 60 for your case for k =...

How to expand a Matrix ?

Hi, this would work i think: A = [1 2 3; 4 5 6] n = 3 % Number of repeated values --> 60 for your case for k =...

9 hours ago | 0

Answered

Plot the curve described by the following equations

t = linspace(-1000,1000,500); x = (1-t.^2)./(1+t.^2); y = 2.*t./(1+t.^2); subplot(2,1,1) plot(t,x,'-r') subplot...

Plot the curve described by the following equations

t = linspace(-1000,1000,500); x = (1-t.^2)./(1+t.^2); y = 2.*t./(1+t.^2); subplot(2,1,1) plot(t,x,'-r') subplot...

23 hours ago | 1

| accepted

Answered

How do I create a row vector with 100 samples of silence using the zeros function? I have tried the following combinations:

Hi, % Defining a row vector of size 1x100 containing all zeros: y=zeros(1,100); % Defining a column vector of siz...

How do I create a row vector with 100 samples of silence using the zeros function? I have tried the following combinations:

Hi, % Defining a row vector of size 1x100 containing all zeros: y=zeros(1,100); % Defining a column vector of siz...

23 hours ago | 0

Answered

using gamultiobj with 24 variables

Hi, the input syntax for <https://de.mathworks.com/help/gads/gamultiobj.html?s_tid=doc_ta *|gamultiobj|*> has no option for p...

using gamultiobj with 24 variables

Hi, the input syntax for <https://de.mathworks.com/help/gads/gamultiobj.html?s_tid=doc_ta *|gamultiobj|*> has no option for p...

1 day ago | 0

Answered

How to find numerical solutions of equation using fzero or solve

Hi, examples how to use <https://de.mathworks.com/help/matlab/ref/fzero.html *|fzero|*> or <https://de.mathworks.com/help/opt...

How to find numerical solutions of equation using fzero or solve

Hi, examples how to use <https://de.mathworks.com/help/matlab/ref/fzero.html *|fzero|*> or <https://de.mathworks.com/help/opt...

1 day ago | 0

Answered

How do i minimze my fuzzy logic controller using genetic algorithm?

Hi, ga passes only one x with 6 entries to the objective function. Try the attached version. I could not test, since i do not...

How do i minimze my fuzzy logic controller using genetic algorithm?

Hi, ga passes only one x with 6 entries to the objective function. Try the attached version. I could not test, since i do not...

3 days ago | 0

Answered

I downloaded the signal processing toolbox, how do I load it into MATLAB?

Hi, see here: <https://de.mathworks.com/matlabcentral/answers/101885-how-do-i-install-additional-toolboxes-into-an-existin...

I downloaded the signal processing toolbox, how do I load it into MATLAB?

Hi, see here: <https://de.mathworks.com/matlabcentral/answers/101885-how-do-i-install-additional-toolboxes-into-an-existin...

3 days ago | 0

Answered

comparing consecutively numbers to find the peaks of a function

Hi, have a look at <https://de.mathworks.com/matlabcentral/fileexchange/25500-peakfinder-x0-sel-thresh-extrema-includeendpoin...

comparing consecutively numbers to find the peaks of a function

Hi, have a look at <https://de.mathworks.com/matlabcentral/fileexchange/25500-peakfinder-x0-sel-thresh-extrema-includeendpoin...

4 days ago | 0

Answered

xlsread unable to open file

Hi, path = 'C:\Users\Stephan\Desktop'; filename = 'test.xlsx'; fullpath = [path, '\', filename]; data = xlsread(fu...

xlsread unable to open file

Hi, path = 'C:\Users\Stephan\Desktop'; filename = 'test.xlsx'; fullpath = [path, '\', filename]; data = xlsread(fu...

4 days ago | 1

| accepted

Answered

ERROR Dimensions of arrays being concatenated are not consistent.

X = [2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23]; Y = [23,22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10...

ERROR Dimensions of arrays being concatenated are not consistent.

X = [2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23]; Y = [23,22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10...

7 days ago | 0

| accepted

Answered

Why getting some strange fractions? The code is simple and correct,maybe.

Hi, if you calculate symbolic equation, the calculated values (like factors for example) in symbolic equations are represente...

Why getting some strange fractions? The code is simple and correct,maybe.

Hi, if you calculate symbolic equation, the calculated values (like factors for example) in symbolic equations are represente...

7 days ago | 0

Answered

Compute Mode of values in array greater than 0

Hi, here is a workaround using the properties of <https://de.mathworks.com/help/matlab/ref/nan.html *|NaN|*> : A = [0 0 ...

Compute Mode of values in array greater than 0

Hi, here is a workaround using the properties of <https://de.mathworks.com/help/matlab/ref/nan.html *|NaN|*> : A = [0 0 ...

7 days ago | 1

| accepted

Answered

Need help plotting a directional field, along with some specific solutions(on the same graph)

Hi, if you type: whos y1 you will see the reason for the error message. y1 is a sym object and therefore can not be p...

Need help plotting a directional field, along with some specific solutions(on the same graph)

Hi, if you type: whos y1 you will see the reason for the error message. y1 is a sym object and therefore can not be p...

7 days ago | 0

Answered

I would like to understand this statement in matlab: x=y(z) where y and z are both vectors

Hi, x gets the value of y which is found at index z in y. y=5:9 z=3 x=y(z) results in x = 7, since 7 is found a...

I would like to understand this statement in matlab: x=y(z) where y and z are both vectors

Hi, x gets the value of y which is found at index z in y. y=5:9 z=3 x=y(z) results in x = 7, since 7 is found a...

7 days ago | 0

| accepted

Answered

Problem in conversion the state-space of the system to transfer function

Hi, this appears to run: s=tf('s'); G=(s^3+11*s^2+36*s+26)/(s^4+14.6*s^3+74.96*s^2+156.7*s+99.65); [sys,g] = balre...

Problem in conversion the state-space of the system to transfer function

Hi, this appears to run: s=tf('s'); G=(s^3+11*s^2+36*s+26)/(s^4+14.6*s^3+74.96*s^2+156.7*s+99.65); [sys,g] = balre...

7 days ago | 0

| accepted

Answered

How to convert the data from three array: x,y,z into mesh format

Hi, if your x-data and y-data is sorted this way you can simply do a transposed <https://de.mathworks.com/help/matlab/ref/res...

How to convert the data from three array: x,y,z into mesh format

Hi, if your x-data and y-data is sorted this way you can simply do a transposed <https://de.mathworks.com/help/matlab/ref/res...

7 days ago | 0

Answered

ODE45, differential equation

Hi, if you search a value for k that complies with the boundary conditions, you could use <https://de.mathworks.com/help/matl...

ODE45, differential equation

Hi, if you search a value for k that complies with the boundary conditions, you could use <https://de.mathworks.com/help/matl...

7 days ago | 0

| accepted

Answered

Add space between scatterpoint and text label?

Hi, depending on how you want to move the text with respect to your data you can use the * 'HorizontalAlignment' - Propert...

Add space between scatterpoint and text label?

Hi, depending on how you want to move the text with respect to your data you can use the * 'HorizontalAlignment' - Propert...

8 days ago | 0

| accepted

Answered

Having trouble graphing a non-linear graph

x = -2:0.01:2; y = cos(x)+exp(-1/2*x.^2).*sin(6*x); plot(x,y)

Having trouble graphing a non-linear graph

x = -2:0.01:2; y = cos(x)+exp(-1/2*x.^2).*sin(6*x); plot(x,y)

8 days ago | 0

| accepted

Answered

how to draw the power series in matlab

%range of n=25 n = 0:25; y = cumsum(1./factorial(n)); % plot results plot(n,y,'r')

how to draw the power series in matlab

%range of n=25 n = 0:25; y = cumsum(1./factorial(n)); % plot results plot(n,y,'r')

9 days ago | 0

| accepted

Answered

addition of two arrays element by element creating matrix

Hi, A = 2:6; B = 3:8; [m,n] = meshgrid(1:length(A),1:length(B)); C = A(m) + B(n); Change A and B like needed....

addition of two arrays element by element creating matrix

Hi, A = 2:6; B = 3:8; [m,n] = meshgrid(1:length(A),1:length(B)); C = A(m) + B(n); Change A and B like needed....

10 days ago | 0

Answered

Plot z = x^2 + y^2 over the interval -4 <= x <= +4, -4 <= y <= +4.

Hi, use: syms x y f(x,y) = x^2 + y^2; fsurf(f, [-4 4 -4 4]) Note that this will work if you have access to th S...

Plot z = x^2 + y^2 over the interval -4 <= x <= +4, -4 <= y <= +4.

Hi, use: syms x y f(x,y) = x^2 + y^2; fsurf(f, [-4 4 -4 4]) Note that this will work if you have access to th S...

10 days ago | 0

Answered

where is the planetary gear block in simulink/how can i make one?

Hi, you find the gear (and some other types of gears) in the model library: <</matlabcentral/answers/uploaded_files/132403...

where is the planetary gear block in simulink/how can i make one?

Hi, you find the gear (and some other types of gears) in the model library: <</matlabcentral/answers/uploaded_files/132403...

10 days ago | 0

| accepted

Answered

How to convert a csv into .mat file ? Considering my csv file has one array with non numerical values ?

Hi, <https://de.mathworks.com/help/matlab/ref/dlmread.html *|dlmread|*> will read ASCII-delimited file of *numeric data* into...

How to convert a csv into .mat file ? Considering my csv file has one array with non numerical values ?

Hi, <https://de.mathworks.com/help/matlab/ref/dlmread.html *|dlmread|*> will read ASCII-delimited file of *numeric data* into...

10 days ago | 0

Answered

What controls of this error 'Inner matrix dimensions must agree'?

When using * in Matlab with non-scalars, matlab follows the calculation rules of linear algebra: >> A = randi(10,3,2) ...

What controls of this error 'Inner matrix dimensions must agree'?

When using * in Matlab with non-scalars, matlab follows the calculation rules of linear algebra: >> A = randi(10,3,2) ...

11 days ago | 0

| accepted

Answered

how to import simscape hydraulic block in matlab R2018a? Anyone can help

Hi, open the library browser: <</matlabcentral/answers/uploaded_files/132243/library_browser.PNG>> . then you find h...

how to import simscape hydraulic block in matlab R2018a? Anyone can help

Hi, open the library browser: <</matlabcentral/answers/uploaded_files/132243/library_browser.PNG>> . then you find h...

11 days ago | 0

Answered

Can anbody solve this simple equation?

Hi, to obtain values from your function use this: fun_rg = @(R_g0,sigma_1,sigma_2,x)exp((x.^2.*(R_g0.^2-1.0).^2.*(1.0./2...

Can anbody solve this simple equation?

Hi, to obtain values from your function use this: fun_rg = @(R_g0,sigma_1,sigma_2,x)exp((x.^2.*(R_g0.^2-1.0).^2.*(1.0./2...

11 days ago | 0

Answered

Nested if in a for loop won't work

Hi, read how matlab works, in the answer above and the given links. Try this: L=500; a=300; P=150; EI=400; n...

Nested if in a for loop won't work

Hi, read how matlab works, in the answer above and the given links. Try this: L=500; a=300; P=150; EI=400; n...

12 days ago | 1

| accepted