Community Profile

# Stephan Jung

310 total contributions since 2017

Knowledge means knowing where it is written...

Interested in:
- Optimization
- Mathematical Modelling
- Improvement of my programming skills

View details...

Contributions in
View by

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

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

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

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

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

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

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

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

3 days ago | 0

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

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

4 days ago | 1

| accepted

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

10 days ago | 0

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

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

11 days ago | 0

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