Answered
Help in curve fitting tool box
Hi, replace 'x' by 'Sigma' in the line above your custom equation: y = f(x) --> y = f(Sigma) Best regards Stephan

7 years ago | 0

| accepted

Answered
How to filter a table in matlab and then assign a value using a loop
Hi, try: % Define a column for Scores A.Score(1:size(A,1),1) = 0; % Scores due to Tumor Size A.Score(A.TumorSize=='pT2' | A...

7 years ago | 1

| accepted

Answered
script for looping function
Hi, try: t=0:.1:100; %generates array of time from 0 to 100 in 0.1 increments a=0.1; %variables to generate f1 and f2 b=5; ...

7 years ago | 0

Answered
What's the differnce between 'optimization toolbox' and 'global optimization toolbox'?
Hi, fmincon is only part of the Optimization Toolbox - not part of the Global Optimization Toolbox. Thus you do not need to cho...

7 years ago | 1

| accepted

Answered
Normalization of an array of double
Hi, in R2018b use: A = A ./ max(A,[],'all') If you need performance use the good old classic way (see comment on the other an...

7 years ago | 0

| accepted

Answered
From negative to positive
Hi, if you have no complex numbers: abs(A) For complex numbers abs will calculate the magnitude. Best regards Stephan

7 years ago | 3

| accepted

Answered
logical to index values convert
Hi, try: a = [1 2 3 4 5 6 7 6 5 4 3 2 1]; % 1x13 double for i = 1:length(a)-1 out(i) = (a(i)>a(i+1)); in(i) = (a(i)...

7 years ago | 0

Answered
cell array concept issue
Hi, in general no for loop is needed. See the following 2 examples how you could proceed in a simple example: % 10 random val...

7 years ago | 0

Answered
removing duplicates in an array
b = a(logical([1 (diff(a)~=0)]))

7 years ago | 1

| accepted

Answered
signal statues Name function
Hi, you fogot to specify that it is a function. This is why the error occurs: function res = getSignalStatusName(myParam) ...

7 years ago | 0

Answered
Vectors must be same length error
Hi, i suggest to make life easier by working with a table: % import your txt-file as table Th = readtable('IMT1.txt','Multipl...

7 years ago | 0

Answered
concatenating 3x1 array
Hi, try: result = datetime([0 0 0 18 11 5.635], 'Format', 'HH:mm:ss.SSS') Best regards Stephan

7 years ago | 0

| accepted

Answered
Issues with function ismember
Hi, ismember(A,B) returns a logical 1 at the Locations where an element of B occurs in A. Therefore it is normal that zeros oc...

7 years ago | 0

Answered
How do i know if my laptop is MATLAB compatible? (Is there any simple test by which i can simply know it can handle MATLAB)
https://de.mathworks.com/support/requirements/matlab-system-requirements.html Best regards Stephan

7 years ago | 1

Answered
How to select/pick specific 3*3 matrix from 6*6 matrix in MATLAB?
Hi, for the lower right 3x3 matrix use: A = k(4:end,4:end) for the marked area (4×3): A = k(3:end,4:end) An upper left 2×2 ...

7 years ago | 2

| accepted

Answered
Struggling to use ode 45
Hi, try A0= 0.03; m0= [0,0.1,0.3]; p0= [0.1,0.4,0.5]; tspan=[0,800]; [t,y]=ode45(@(t,y)odefun(t,y,A0,m0,p0),tspan, [m0 p0]...

7 years ago | 0

| accepted

Answered
Formula for the exact solution u1(u) and u2(t)?
Hi, try: syms u1(t) u2(t) A = [12 15; -10 -13]; cond = [u1(0) == 3; u2(0) == -2] ode = [diff(u1,t); diff(u2,t)] == A * [u1;...

7 years ago | 0

| accepted

Answered
How can I define norm of a vector as a symbolic function?
Hi, try: syms g(x,v) v = sym('v', [1,3]); g(x,v) = norm(v) g(x, v1, v2, v3) = (abs(v1)^2 + abs(v2)^2 + abs(v3)^2)^(1/...

7 years ago | 0

| accepted

Answered
can someone help me create function with 2 inputs that creates a single output?
Hi, start reading here and work through the examples given: https://de.mathworks.com/help/matlab/ref/function.html Best regar...

7 years ago | 0

| accepted

Answered
subpopulations and parallel processing in ga
Hi, we do find the same note as in the question you referred to, in the R2018b documentation here: "...Subpopulations refer to...

7 years ago | 1

Answered
Why does it become four number in a line?
Hi, you do linear indexing which lets Matlab reshape A. To avoid this use: A(:,1)=[] Best regards Stephan

7 years ago | 0

| accepted

Answered
Error in fmincon - getIpOptions not found
Hi, use: options = optimoptions(@fmincon,'Display','off'); Best regards Stephan

7 years ago | 0

Answered
System of differential equations
Hi, in this lines you use x (which is a vector with 6 elements) instead of x(i) - which is a scalar: xdot(5)=(sin(x)*(1/rc-1/2...

7 years ago | 0

| accepted

Answered
cell of minutes and seconds
time= {[3,41] [2,59] [3,12] [5,27]}; time_1 = [time{:}]; mins = minutes(time_1(1,1:2:end)) + seconds(time_1(1,2:2:end))

7 years ago | 0

Answered
How do I get the x vector from a fifth degree function with a given y vector ?
Hi, if you are interested in only the real solutions you can use: y = [1.3579 1.3571 1.3571 1.3567 1.3568 1.3565 1.357 1.3571 ...

7 years ago | 0

Answered
User Input Error? Using input in a function
Hi, try: result = mydistance function d = mydistance prompt = 'Input coordinates between which you want to find the gr...

7 years ago | 0

Answered
To know what number is not available in an array.
A=[ 1 7 3 8 7 2 6] Missing = find(~ismember(min(A):max(A),A))

7 years ago | 2

| accepted

Answered
Solve multiple equations dependent on each other, knowing how one variable changes
Hi, due to N is a vector you have to use '.*' and './' to perform elementwise operations and avoid this error. Since h is not d...

7 years ago | 0

Answered
Need to define an array
Hi, note that the length of T is 49 - not 98. The proper way to do this is: Fg=zeros(1,98); Fg(1:2:end) = linspace(1000,100,...

7 years ago | 0

Answered
readtable ommits NaNs at top of column?
Hi, this worked for me: testA=readFromTable("test.xlsx",'Sheet1','A1:A9'); testB=readFromTable("test.xlsx",'Sheet1','B1:B9');...

7 years ago | 1

| accepted

Load more