Domanda

How to publish results from the command window in MATLAB

Hi, I ran a code it took 5 hours to give me results in the command window now I want to print the results from the command wind...

quasi 4 anni fa | 3 risposte | 0

Domanda

How to use questdlg to ask the user for an action?

I want to ask the user to make a choice on which function to excute the algorithm is as follows: Ask the user "what type of se...

quasi 4 anni fa | 1 risposta | 0

Domanda

The crtrp function from the genetic-toolbox doesn't work

Whenever I try to run the code, it gives me an erorr saying: Error: File: crtrp.m Line: 34 Column: 19 "nargin" previously appe...

quasi 4 anni fa | 1 risposta | 0

Domanda

I have problem writing a matlab function

I want to write this function in matrix form. The function is I defined the vector as: Then what is wrong with my code? fu...

quasi 4 anni fa | 3 risposte | 0

Domanda

A question about sorting a vector

Suppose I have a column vector V of length N and I map every element in V to an element y in Y so, we have a column vector Y of ...

circa 4 anni fa | 1 risposta | 0

Domanda

How to find the position of an element in a vector

Hello, Is there a function in matlab that takes a column vector of n rows and a number as an input and returns its position ...

circa 4 anni fa | 2 risposte | 0

Domanda

How to generate a random integer between two bounds?

Hello, I want to generate a random integer between two integers Suppose the upper bound UP=500 and the lower bound LB=4 how ...

circa 4 anni fa | 1 risposta | 0

Domanda

Why the function "bi2de" only returns non-negative integers, when the description says it returns non-negative real numbers!

I read that the function bi2de takes any binary vector - "a vector composed of only zeros and ones" and returns a non-negative r...

circa 4 anni fa | 1 risposta | 0

Domanda

Why does matlab return "Index exceeds matrix dimensions"?

Hello, Nind=2; %number of vectors Nvar=2; %number of variables in each vector perci=3; %number of bits of every variable p...

circa 4 anni fa | 0 risposte | 0

Domanda

A question about the simple genetic algorithm code

This is a code I found of the genetic algorithm. I am a beginner in MATLAB but I really would like to understand the code. The C...

circa 4 anni fa | 0 risposte | 0

Domanda

Given a column matrix of numbers, how to extract some numbers that meet some condition and save them in a new matrix, if I don't know how many numbers will meet the condition?

Suppose I have a matrix R of n rows and 1 column, suppose I want to extract all numbers from matrix R that are less than or equa...

oltre 4 anni fa | 1 risposta | 0

Domanda

Error: The first argument must be a scalar.

I defined a matrix of variables like this X=sym('X', [4,1]) %it looks like this X=[X1 X2 X3 X4]' Then the code did some stu...

oltre 4 anni fa | 1 risposta | 0

Domanda

Loop over non-numeric stuff

Hello, I defined a vector of variables in my code like this x=sym('x', [m,1]) then I defined a matrix M as follows M=zeros(m...

oltre 4 anni fa | 0 risposte | 0

Domanda

I have an idea that I want to write in MATLAB language

I am trying to write a MATLAB code that does the following the user should enter 3 vectors (x1, x2, x3) each has 2 components th...

oltre 4 anni fa | 1 risposta | 0

Domanda

Need some help with a while loop

x0=[0.8 0.8 0.2 0.2]'; tol=1e-6; m0=[0.5 0.5]'; syms x y z p m1 m2 h1=y-(x^3)-(z^2); h2=(x^2)-y-p^2; h=[h1 h2]'; f=-x; ...

oltre 4 anni fa | 1 risposta | 0

Domanda

Something is wrong in my line search gradient descent code. It gets stuck!

x0=[10 5]'; x0=[10 5]'; tol=1e-6; syms x y f= (1/2)*(x^2)+(9/2)*(y^2); g=gradient(f, [x, y]); g0=subs(g, x, x0(1,1)); g0=...

oltre 4 anni fa | 1 risposta | 0