Answered
Matlab: complex legends
plot(1:10,rand(1,10),'^-','color','r') hold on plot(1:10,rand(1,10),'o-','color','b') legend

5 years ago | 0

Answered
How do I plot rectangles with filled color on a 2D plot?
Read about fill, patch. You need to have coordinates of the vertices. Example: % Vertices of rectangle P = [0 0 ;0 1; 1 1;...

5 years ago | 0

| accepted

Answered
How to copy and paste multiple columns from different tables to the destination table in excel.
I am assuming that the length of column in each csv file is same. clc clear all csvFiles = dir('*.csv'); numfiles = length...

5 years ago | 0

| accepted

Answered
Auto complete filename and filepath - append
for i = 1:10 txtFile = strcat('user_',num2str(i),'.txt') ; imageFile = ['userImage_',num2str(i),'.jpeg'] ; % sa...

5 years ago | 0

Answered
How to find max value of a vector in a certain time interval?
There are multiple ways to achieve this. Method 1: Do interpolation for the time range get the respective values and use max. ...

5 years ago | 0

Answered
finding roots of equation
syms x eqn = 0.5*(x-2).^3-40*sin(x) == 0 ; s = vpasolve(eqn,x)

5 years ago | 1

| accepted

Answered
how to solve this error horzcat Dimensions of matrices being concatenated are not consistent?
Learn about debugginf a code here: https://in.mathworks.com/help/matlab/matlab_prog/debugging-process-and-features.html You ca...

5 years ago | 0

| accepted

Answered
grouping data in column vector based on another vector
A = [0; 1; 2; 3; 4] ; B = [15;16 ;17; 18; 20;19;7;8;22;25] ; N = length(A) ; C = cell(N,1) ; for i = 1:N if A(i) == 0...

5 years ago | 0

| accepted

Answered
How to convert "64x128 single" into "64x128 double"?
You can convert a array A which single into double using: A = double(A) ; Read about single and double.

5 years ago | 2

Answered
How do I change this code for RGB images?
In this line Ii=Ii(:,:,rgb); You are overwrititng the m*n*3 image variable into a 1D matrix. Thus you lost your rgb original i...

5 years ago | 0

| accepted

Answered
please suggest me how to solve this problem
The error is clear and simple. You are trying to save more number of elements then initialized into the matrix. A = zeros(2,3)...

5 years ago | 0

| accepted

Answered
How do I read the strings from the xlsx file? I have read the data, but can't get the string?
Don't use importdata to read the xlsx file. You should use readtable.

5 years ago | 0

Answered
Finding value that gives the max when entered in equations
Along with max value you can get the index also...use this index to get the value of respective theta. clear ; clc; x0 = 0; %...

5 years ago | 1

| accepted

Answered
convert complex number to Integers
cordicexp calculates cos(theta)+i*sin(theta) To make cordicexp and exp same you need to use: exp(i*theta) Remember Euler's...

5 years ago | 0

Answered
x,y coordinates of text
You can use functions like strfind to get the position of the required string from the main string. str = 'Lorem ipsum dolor s...

5 years ago | 0

Answered
Why the for-loop doesn't work here?
You save all the values into an array and plot after the for-loop. %% ------------------------------Program-------------------...

5 years ago | 0

Answered
Storage elements from matrix in other one, with indexing.
A = [8 3 0 2 9 6 1 4 10 6 2 1 1 6 2 8 ]; a=2; b=4; [X,Y] = meshgrid([a b],[a b]) ; id = sub2ind(size(A)...

5 years ago | 1

| accepted

Answered
How to merge x and y values to a (x,y) format?
As the dimensions of xi_total and yi_total remain same i.e. 201*1 in the entire loop of length 1:sample; you can save the data i...

5 years ago | 1

| accepted

Answered
How to plot a Bar Graph without a uniform spacing on the horizontal axis
You can plot the values by index and show the respective values uisng text. Example: x = [5 10 100 1000] ; y = rand(size(x)...

5 years ago | 0

| accepted

Answered
Input data size does not match network inputs size
Replace the line: net=newff([-1 1], [130,150,1], {'tansig','tansig','purelin'},'traingd'); with: PR = [min(P,[],2) max(P,[],...

5 years ago | 1

| accepted

Answered
How to change output in FOR Loop
X = zeros(12,1) ; for k = 1:1:12 X(k) = find(DateVector(:,2) == k)'; end The above is fine enough. You should go by in...

5 years ago | 0

Answered
How to compute weighted average
A = [54 50 ; 40 60 ; 30 70] ; A(:,3) = 0.4*A(:,1)+0.6*A(:,2)

5 years ago | 0

| accepted

Answered
Preallocating array error problem
You need to initialize the variable before the loop. Initialize using: error_history = zeros([],1) ; Note: Don't show your co...

5 years ago | 0

| accepted

Answered
How to generate random vector with boundary limit and with fixed sum? Also ensure to same value when called the function with same parameters.
rand creates random number every time. If you fix the seed, then you will get the same random number. Read about rng.

5 years ago | 1

Answered
How do I draw the same graph as the picture?
x1 = [4.158236141 6.153599506 -4.535940798 7.598349019 1.546377884 -1.345068203 9.996482015 -0.173832303 -4.963945249 7.60191503...

5 years ago | 0

| accepted

Answered
How do you get the value for any point on the response plane?
x1 = [4.158236141 6.153599506 -4.535940798 7.598349019 1.546377884 -1.345068203 9.996482015 -0.173832303 -4.963945249 7.60191503...

5 years ago | 0

| accepted

Answered
how to merge two tables with same column names into one table?
T1 = array2table(rand(4,3), 'VariableNames', {'A', 'B', 'C'}) ; T2 = array2table(rand(4,3), 'VariableNames', {'A', 'B', 'C'}) ;...

5 years ago | 0

Answered
Changing Data in a Table
Name = {'Al Pacino', 'Angelina Jolie','Robert De Niro','Russel Crowe','Kate Winslet','Julia Roberts'} ; Sex = {'M','F','M','M',...

5 years ago | 0

Answered
calculate the sum of a discert series and then limit the the result
syms k n f = symsum(1/(k+n),k,1,n) s = limit(f,n,inf)

5 years ago | 0

| accepted

Load more