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

oltre 7 anni fa | 0

| accettato

Risolto


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...

oltre 7 anni fa

Risolto


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...

oltre 7 anni fa

Risolto


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...

oltre 7 anni fa

Risposto
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...

oltre 7 anni fa | 4

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

oltre 7 anni fa | 1

Risposto
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

oltre 7 anni fa | 0

| accettato

Risposto
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...

oltre 7 anni fa | 0

| accettato

Risposto
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_...

quasi 8 anni fa | 3

| accettato

Risposto
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 ...

quasi 8 anni fa | 1

| accettato

Risposto
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...

quasi 8 anni fa | 1

| accettato

Risposto
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...

quasi 8 anni fa | 0

| accettato

Risposto
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) ==...

quasi 8 anni fa | 0

| accettato

Risposto
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...

quasi 8 anni fa | 0

Risposto
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); ...

quasi 8 anni fa | 2

| accettato

Risposto
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...

quasi 8 anni fa | 4

| accettato

Risposto
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, [],[],[],[],[...

quasi 8 anni fa | 0

Risposto
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])

quasi 8 anni fa | 0

Risposto
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...

quasi 8 anni fa | 1

| accettato

Risposto
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 ...

quasi 8 anni fa | 0

| accettato

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

quasi 8 anni fa | 0

| accettato

Risposto
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...

quasi 8 anni fa | 0

| accettato

Risposto
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 ...

quasi 8 anni fa | 0

| accettato

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

quasi 8 anni fa | 0

| accettato

Risposto
fminunc error message multiple variables

quasi 8 anni fa | 0

Risposto
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...

quasi 8 anni fa | 0

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

quasi 8 anni fa | 0

| accettato

Risposto
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...

quasi 8 anni fa | 1

| accettato

Risposto
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...

quasi 8 anni fa | 0

| accettato

Risposto
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 ...

quasi 8 anni fa | 0

Carica altro