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

más de 7 años hace | 0

| aceptada

Resuelto


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

más de 7 años hace

Resuelto


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

más de 7 años hace

Resuelto


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

más de 7 años hace

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

más de 7 años hace | 4

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

más de 7 años hace | 1

Respondida
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

más de 7 años hace | 0

| aceptada

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

más de 7 años hace | 0

| aceptada

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

más de 7 años hace | 3

| aceptada

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

más de 7 años hace | 1

| aceptada

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

más de 7 años hace | 1

| aceptada

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

más de 7 años hace | 0

| aceptada

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

más de 7 años hace | 0

| aceptada

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

más de 7 años hace | 0

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

más de 7 años hace | 2

| aceptada

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

más de 7 años hace | 4

| aceptada

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

más de 7 años hace | 0

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

más de 7 años hace | 0

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

más de 7 años hace | 1

| aceptada

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

más de 7 años hace | 0

| aceptada

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

más de 7 años hace | 0

| aceptada

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

más de 7 años hace | 0

| aceptada

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

más de 7 años hace | 0

| aceptada

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

más de 7 años hace | 0

| aceptada

Respondida
fminunc error message multiple variables

más de 7 años hace | 0

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

más de 7 años hace | 0

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

más de 7 años hace | 0

| aceptada

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

más de 7 años hace | 1

| aceptada

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

más de 7 años hace | 0

| aceptada

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

más de 7 años hace | 0

Cargar más