Answered

how will I replace a string with another string without using strrep?

If you still want to keep your line of thought instead of using Bhaskar approach, which is simpler, you can: % Example entries ...

how will I replace a string with another string without using strrep?

If you still want to keep your line of thought instead of using Bhaskar approach, which is simpler, you can: % Example entries ...

4 days ago | 0

Question

Is there an alternative way to perform the following matrix transformation?

Is there a better way to perform the following operation. For example, for the following matrix: A = 1 13 25 ...

15 days ago | 2 answers | 0

Answered

How do i find x in an equation using the solve command?

Do you have Symbolic Math Toolbox? Try the following: syms x fcn = x-2; solve(fcn == 0)

How do i find x in an equation using the solve command?

Do you have Symbolic Math Toolbox? Try the following: syms x fcn = x-2; solve(fcn == 0)

15 days ago | 1

Answered

Why is my plot blank? (New to MATLAB)

Try the following: x = -pi:.1:pi; for i=1:length(x) S(i) = (2.*heaviside(x(i)))-1; end figure plot(S,x,'-r*'); axis([...

Why is my plot blank? (New to MATLAB)

Try the following: x = -pi:.1:pi; for i=1:length(x) S(i) = (2.*heaviside(x(i)))-1; end figure plot(S,x,'-r*'); axis([...

15 days ago | 0

Answered

Find set of values that are unique to the values in another column

% Mqtrix A =[2 3; 2 6 2 8 4 5 5 9 5 39 5 6] % Get unique values on first collumn un = unique(A(...

Find set of values that are unique to the values in another column

% Mqtrix A =[2 3; 2 6 2 8 4 5 5 9 5 39 5 6] % Get unique values on first collumn un = unique(A(...

15 days ago | 0

| accepted

Answered

Extract Min, Max and mean values for each month of each respective year. (Excel Data)

%% Initialize variables. filename = 'temptable.csv'; delimiter = ','; startRow = 3; %% Format for each line of text: form...

Extract Min, Max and mean values for each month of each respective year. (Excel Data)

%% Initialize variables. filename = 'temptable.csv'; delimiter = ','; startRow = 3; %% Format for each line of text: form...

15 days ago | 0

Answered

How can I ready a m file form a exe program?

See Kaustubha Govind answers in https://www.mathworks.com/matlabcentral/answers/23369-generating-standalone-executable-file-us...

How can I ready a m file form a exe program?

See Kaustubha Govind answers in https://www.mathworks.com/matlabcentral/answers/23369-generating-standalone-executable-file-us...

16 days ago | 0

Answered

I'm trying to define a simbolic variable like ¨ syms x ¨. I used to do it but now It doesn't work..

Maybe you do not have the Symbolica Package installed or do not have license. Run the following comand on command windows: ver ...

I'm trying to define a simbolic variable like ¨ syms x ¨. I used to do it but now It doesn't work..

Maybe you do not have the Symbolica Package installed or do not have license. Run the following comand on command windows: ver ...

16 days ago | 1

Answered

Help !! Problems Using fmincon

I see that you already have choose your solver, which is fmincon. Go over on the Description of the solver and note it contains ...

Help !! Problems Using fmincon

I see that you already have choose your solver, which is fmincon. Go over on the Description of the solver and note it contains ...

16 days ago | 1

Answered

How do I compare to matrices with each other?

If I understood right, you want to compare the first 1000 rows of these two matrix. % Sample Matrix A = rand(1000, 3); B = ra...

How do I compare to matrices with each other?

If I understood right, you want to compare the first 1000 rows of these two matrix. % Sample Matrix A = rand(1000, 3); B = ra...

17 days ago | 1

Answered

Running a calculation for an entire array and putting the results into a new array

% Given A as: A = 1:194; % We can simply solve the following: B = 2+2./A;

Running a calculation for an entire array and putting the results into a new array

% Given A as: A = 1:194; % We can simply solve the following: B = 2+2./A;

17 days ago | 0

| accepted

Answered

How to plot individual data on a 2D line graph

See the following example: % Sample Data x = 0:.1:2*pi; y = sin(x); % Find maximun value [max_point, idx] = max(y); fi...

How to plot individual data on a 2D line graph

See the following example: % Sample Data x = 0:.1:2*pi; y = sin(x); % Find maximun value [max_point, idx] = max(y); fi...

17 days ago | 1

Answered

Producing outputs from loop

for N=1:1068 [pks,locs] = findpeaks(xMatrix(:,N),'MinPeakDistance',20,'MinPeakHeight',750); B = rmoutliers(pks,'mean')...

Producing outputs from loop

for N=1:1068 [pks,locs] = findpeaks(xMatrix(:,N),'MinPeakDistance',20,'MinPeakHeight',750); B = rmoutliers(pks,'mean')...

17 days ago | 0

| accepted

Answered

for loop for reading numbers from a matrix in each row

% Matrix a a =[1 2 4; 3 4 5; 5 6 2] % Get size of a [n, m] = size(a); % Run throu...

for loop for reading numbers from a matrix in each row

% Matrix a a =[1 2 4; 3 4 5; 5 6 2] % Get size of a [n, m] = size(a); % Run throu...

17 days ago | 0

| accepted

Answered

concatenate column values in a vector

You can use the following line of code: v2 = sum(v1*diag(10.^(length(v1)-1:-1:0)));

concatenate column values in a vector

You can use the following line of code: v2 = sum(v1*diag(10.^(length(v1)-1:-1:0)));

17 days ago | 1

Answered

Give me some help to solve this problem ?

First, your code shows two different variables: BW and bw. Also, you might adjust the binarization with some threshold. BW = i...

Give me some help to solve this problem ?

First, your code shows two different variables: BW and bw. Also, you might adjust the binarization with some threshold. BW = i...

17 days ago | 1

| accepted

Answered

Add text to individual frame using Videowriter.

See the following functions: text or annotation.

Add text to individual frame using Videowriter.

See the following functions: text or annotation.

17 days ago | 0

| accepted

Answered

matlab not reading images from folder in correct sequence

It had happened to me before. The problem is the files name is sorted in according to the strings. Let's say you have the follo...

matlab not reading images from folder in correct sequence

It had happened to me before. The problem is the files name is sorted in according to the strings. Let's say you have the follo...

17 days ago | 0

Answered

How to sum the minor number of each line in a matrix?

Given matrix A as: A = [9 6 3; 8 5 2; 7 4 1]; % Sample Matrix minA = min(A,[],2); % Ret...

How to sum the minor number of each line in a matrix?

Given matrix A as: A = [9 6 3; 8 5 2; 7 4 1]; % Sample Matrix minA = min(A,[],2); % Ret...

17 days ago | 0

Answered

creating a matrix from two sets of data

Here is a possible solution: x = [1 2 3 4]; y = [1;2]; nx = length(x); c(1:nx,1) = x; c(1:nx,2) = y(1); c(nx+1:2*n...

creating a matrix from two sets of data

Here is a possible solution: x = [1 2 3 4]; y = [1;2]; nx = length(x); c(1:nx,1) = x; c(1:nx,2) = y(1); c(nx+1:2*n...

17 days ago | 0

Answered

creating a matrix from a column vector

Lets say you have your signal (EEG_signal): EEG_signal = rand(1,136704); % Sample SIgnal You can reshape this on matrix format...

creating a matrix from a column vector

Lets say you have your signal (EEG_signal): EEG_signal = rand(1,136704); % Sample SIgnal You can reshape this on matrix format...

17 days ago | 0

| accepted

Solved

Back to basics 8 - Matrix Diagonals

Covering some basic topics I haven't seen elsewhere on Cody. Given an input vector of numbers, output a square array with the...

17 days ago

Solved

Create an index-powered vector

Given a input vector x, return y as index-powered vector as shown below. Example x = [2 3 6 9] then y should be [...

17 days ago

Solved

Change the sign of even index entries of the reversed vector

change the signs of the even index entries of the reversed vector example 1 vec = [4 -1 -2 9] ans = [9 2 -1 -4] example2...

17 days ago

Solved

Return the largest number that is adjacent to a zero

This example comes from Steve Eddins' blog: <http://blogs.mathworks.com/steve/2009/05/27/learning-lessons-from-a-one-liner/ Lear...

18 days ago

Solved

Find the nearest integer

Given a vector of integers and a real number find the closest integer. EX: >> a = [2 4 5 6 8 10]; >> b = 4.6; >> nea...

18 days ago

Solved

Count up then down

Create a function that produces counting up from 0 up to n then down to 0 n=2 --> 0 1 2 1 0 n=3 --> ...

18 days ago

Solved

Squaring Matrix

Square the following matrix using matlab % A = 1 2 3 4 5 6 7 8 So new matrix should display...

18 days ago

Solved

Determine if input is odd

Given the input n, return true if n is odd or false if n is even.

18 days ago

Solved

Make the vector [1 2 3 4 5 6 7 8 9 10]

In MATLAB, you create a vector by enclosing the elements in square brackets like so: x = [1 2 3 4] Commas are optional, s...

18 days ago