Beantwortet
Error using ode45. Must return a column vector?
1x20 is not a column vector, but a row vector. transpose it to 20x1.

mehr als 7 Jahre vor | 0

| akzeptiert

Gelöst


Remove NaN ?
input -> matrix (n*m) with at least one element equal to NaN; output -> matrix(p*m), the same matrix where we deleted the enti...

mehr als 7 Jahre vor

Gelöst


Back to basics 21 - Matrix replicating
Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix, generate an output matrix that consists o...

mehr als 7 Jahre vor

Gelöst


Back to basics 23 - Triangular matrix
Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix, return a matrix with all elements above a...

mehr als 7 Jahre vor

Beantwortet
Why I cannot define a function in live script?
Hi, you are right - it is freezed: But there is nothing wrong with this, since you can not run a function which is defined b...

mehr als 7 Jahre vor | 4

Beantwortet
gauss elimination or inverse
Hi, use polyfit to do this. Best regards Stephan

mehr als 7 Jahre vor | 1

Beantwortet
How to find the running time of the program if I use optimization toolbox?
Hi, maybe you are looking for timeit or for tic / toc. Best regards Stephan

mehr als 7 Jahre vor | 0

| akzeptiert

Beantwortet
When I integrate a constant over Tp I should get the constant but I don't?
Hi, int is a Symbolic Toolbox function. Use either double or integral for direct numeric computation. a0 = double((1/T)*int(10...

mehr als 7 Jahre vor | 0

| akzeptiert

Beantwortet
ODE Solver Running Very "Slowly"
Hi, it is a very bad idea what happens with B_test.m while the solver runs: In every call of the ode function by the solver B_...

mehr als 7 Jahre vor | 3

| akzeptiert

Beantwortet
How to assign the value for Integer variable indices in GA toolbox?
Hi, consider you have 8 variables x(1)...x(8). The following code makes x(1), x(2), x(4) and x(6) integer constrained in range ...

mehr als 7 Jahre vor | 1

| akzeptiert

Beantwortet
Evaluate matrix equation at multiple timesteps
Hi, try: R=[1 0.5; 0.5 1]; M0=[1;1]; u0=[1;0]; x=repmat(linspace(0,1,100),2,1); y = zeros(2,size(x,2)); f=@(x) expm(-R.*x...

mehr als 7 Jahre vor | 1

| akzeptiert

Beantwortet
Order of the Matlab Ode Solutions Appearing at Output?
Hi, unfortunally Matlab sometimes changes the order of outputs to an order which appears not be logical (at least for me). I do...

mehr als 7 Jahre vor | 0

| akzeptiert

Beantwortet
odeToVectorField: Unable to convert the initial value problem to an equivalent dynamical system.
Hi, i deleted my first answer - cause your comment brought me to a new thought - DAE: syms t v1(t) v2(t) v3(t) eq1 = v1(t) ==...

mehr als 7 Jahre vor | 0

| akzeptiert

Beantwortet
i have installed latest version ..... and i cannot find simscape electronics module in that and how to add that one
Hi, Simscape Powersystems and Simscape Electronics have been bundled to Simscape Electrical: https://de.mathworks.com/help/phy...

mehr als 7 Jahre vor | 0

Beantwortet
Using summation containing function for curve fitting
Hi, you can use this script: x0 = [12 3]; x = lsqcurvefit(@(x,t)equation_fit(x,t),x0,t,S) S_calculated = equation_fit(x,t); ...

mehr als 7 Jahre vor | 2

| akzeptiert

Beantwortet
How to solve in MATLAB 2018b ???
Hi, the following runs for me in 2018b: clear all % State equations syms x1 x2 p1 p2 u; Dx1 = x2; Dx2 = -x2 + u; % Cost f...

mehr als 7 Jahre vor | 4

| akzeptiert

Beantwortet
how can I solve an error of a different number of elements in GA multiobjective optimization?
Hi, try: % Optimize with gamultiobj fitness =@levulinicAcid; nvars = 2; [x,fval] = gamultiobj(fitness, nvars, [],[],[],[],[...

mehr als 7 Jahre vor | 0

Beantwortet
How can I plot a matrix's values greater than a value as dots
[x,y] = find(X>1) scatter(x,y,'ro','MarkerFaceColor','r') xlim([0 400]) ylim([0 400])

mehr als 7 Jahre vor | 0

Beantwortet
It says "too many output arguments" when I try to run the function. Why?
Hi, if you change the number of output arguments of a function, make sure to that the number of output arguments in your functi...

mehr als 7 Jahre vor | 1

| akzeptiert

Beantwortet
How can I plot an impulse response h(t) sampled with fs?
Hi, for me your code is running (made some assumptions and a small edit at the plot): % I assume that s1...s4 are scalars and ...

mehr als 7 Jahre vor | 0

| akzeptiert

Beantwortet
Whys isn't this if working?
Hi, consider: >> intervalo = 0 intervalo = 0 >> quant = 0 quant = 0 Now case 1 - what you told Matla...

mehr als 7 Jahre vor | 0

| akzeptiert

Beantwortet
plotting a column of a timetable
Hi, the quotes tell you, that Matlab does not interpret this values as numbers but as datatype char. You can check data type f...

mehr als 7 Jahre vor | 0

| akzeptiert

Beantwortet
Support vector machine classifier
Hi, i recommend to use the classification learner app to do this. The advatage is, that you dont have to write code to do this ...

mehr als 7 Jahre vor | 0

| akzeptiert

Beantwortet
Reshaping an array of n rows in a custom way
B = [unique(A(:,1)) reshape(A(:,2)',[],3)']

mehr als 7 Jahre vor | 0

| akzeptiert

Beantwortet
fminunc error message multiple variables

mehr als 7 Jahre vor | 0

Beantwortet
Can you find the error in this code that aims to sum the digits of a string?
Hi, try : n = '12361927' s=num2str(sumdigits(n)) if strlength(s)==1 s=s; disp('here') else while strlength(s)~=1...

mehr als 7 Jahre vor | 0

Beantwortet
How I can create a three dimensional succession
freq(1,1,:) = (5:0.5:15)*1e9;

mehr als 7 Jahre vor | 0

| akzeptiert

Beantwortet
fminunc error message multiple variables
Hi, fminunc is only able to pass the optimization variable to the objective function. Since your function needs additionally in...

mehr als 7 Jahre vor | 1

| akzeptiert

Beantwortet
Estimating a function in matlab using different values of parameters froma matrix/dataset
Hi, no datasets needed i think, a=-4. syms r x a fun = (2*(r - 1))/(90 - x)^r - (4*(r - 1))/(2*x + 90)^r + (a*(r - 1))/(2*(90...

mehr als 7 Jahre vor | 0

| akzeptiert

Beantwortet
Loading indexed .mat files using a for loop
Hi, maybe this function from FEX will help to create the needed file names: Numbered Filename Array Best regards Stephan ...

mehr als 7 Jahre vor | 0

Mehr laden