Answered
Eliminate certain entries of cell array
If C is your cell array and FR has the indices of cells which are to be removed, use: C(FR) = []

6 years ago | 0

| accepted

Answered
change color scheme of a scatter plot
You should follow like this demo: n = 100 ; x = 1:n ; y = rand(size(x)) ; % divide based on values idx1 = y >=0 & y<0.25 ;...

6 years ago | 1

Answered
How can I convert this cell array into a matrix?
Use reshape after that. iwant = reshape(cell2mat(C),60,[])' ;

6 years ago | 0

| accepted

Answered
regarding plotTING DATA in matlab
% Random data for demo n = 100 ; x = 1:n ; y = rand(size(x)) ; % plot plot(x,y) lgd = ['ymax = ',num2str(max(y))] ; leg...

6 years ago | 0

Answered
How to run this code for 1000 times?
N = 1000 ; MSE = zeros(N,2) ; for i = 1:N %For C1 lambda1 = [60.21, 41.58, 9.11, 8.71, 3.83, 3.74, 18.06] ; r1 = po...

6 years ago | 0

| accepted

Answered
converting a string to a matrix
Read about str2double.

6 years ago | 0

| accepted

Answered
Mean command gives wrong answer
You should change the value of y as your are changing the indices. x=[1,2,3,4,5,6,7,8,9,10,11,12]; % x values y=[15,120,2...

6 years ago | 1

Answered
problem in solve command
% If you have two loops m = 10 ; % rows n = 5 ; % columns iwant = zeros(m,n) ; % initialization % loop start for i = 1...

6 years ago | 0

Answered
How to code the Average monthly temperature? I'm newbie in matlab.. Please help me
It looks like you have a data matrix of size 24X12 . Use mean to get the average. Read about the function mean. If A is your dat...

6 years ago | 0

| accepted

Answered
How to convert time domain to frequency domain using FFT
data = importdata("before test.txt") ; t = data(:,1) ; amp = data(:,2) ; dt = unique(diff(t)) ; % time step Fs = 1/dt ...

6 years ago | 0

| accepted

Answered
hello how do I write this function without getting an error saying "variable K has an incorrect value".
a=-3 ; b= 3; h = (b-a)/N; x=a:h:b; k =abs(x).*exp(-x.^2) ; K = sum(k*h);

6 years ago | 0

Answered
How can I distribute random points in some lines?
%% Striaght line L = rand(2,2) ; P1 = L(1,:) ; P2 = L(2,:) ; % Get slope and y intercept P = polyfit(L(:,1),L(:,2),1) ...

6 years ago | 0

| accepted

Answered
find points of intersection circle with line
clc; clear all ; C = [1.5 1.5] ; % center of cricle r = 1.5 ; % radius of circle % x = 0:1:3 ; y = 0:1:3 ; ...

6 years ago | 0

| accepted

Answered
Linear regression to a matrix
P = polyfit(X,Y,1)

6 years ago | 0

| accepted

Answered
How do I extract file names.
Read about fileparts https://in.mathworks.com/help/matlab/ref/fileparts.html Alos have a look on dir.

6 years ago | 0

| accepted

Answered
How can I plot the values of a vector in colors: 2d position plot plus color.
Read about scatter.

6 years ago | 0

| accepted

Answered
Eigenvalues of a large Matrix
clc; clear all ; clc;clear a=1.0; b=1.0; n=20; I1=eye(n); I2=eye(2); matdimension= (n-1); tempvector = 0:1:matdime...

6 years ago | 0

| accepted

Answered
How to write an elliptic function using for loop
Read about polarplot. https://in.mathworks.com/help/matlab/ref/polarplot.html

6 years ago | 0

Answered
Converting a 3D matrix in 2D matrix by making a average
You can specify the dimension in mean. Read about it. iwant = mean(A,3)

6 years ago | 1

Answered
How to draw 3D plot in matlab with labels?
You can porceed something like this: A = rand(70,6) ; x = 1:70 ; y = ones(size(x)) ; figure hold on for i = 1:6 plot...

6 years ago | 0

| accepted

Answered
how I can plot 3 independent variables in matlab (4 dimensions)?
m = 10 ; n = 10 ; p =10 ; x = linspace(0,1,m); y = linspace(0,2,n) ; z = linspace(2,3,p) ; [X,Y,Z] = meshgrid(x,y,z) ; f...

6 years ago | 0

| accepted

Answered
Request to assist:-
A=[1,0,3; 0,5,6; 7,8,9] ; iwant = A(1,3)+A(2,3)

6 years ago | 0

Answered
How to extract the events which have more than 3 consecutive rows
idx3 = [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

6 years ago | 1

Answered
How to calculate error between 2 curves ?
If y0 is original value and y1 is obtained value. You can get the error using : dy = y0-y1 ; % error abs_dy = abs(y0-y1) ; ...

6 years ago | 4

Answered
finding eigenvectors matching to eigenvalues
The respective Eigenvalues would be diag(D) v1 = V(:,1) ; e1 = D(1,1) ; v2 = V(:,2) ; e2 = D(2,2) ; % and so on

6 years ago | 1

| accepted

Answered
Point of intersection of two plotted column vectors
This your function.....go for it. https://in.mathworks.com/matlabcentral/fileexchange/22441-curve-intersections?focused=5165138...

6 years ago | 0

| accepted

Answered
help random numbers generator
a = -0.5 ; b = 0.5 ; N = 10 ; r = (b-a).*randn(N,1) + a;

6 years ago | 1

Answered
Error for exceeding the loop
Why you have made code that complex? It is a simple task. You can use intersect. d = {[5:10] [20:30]}; e = [1 2 7 8 9 11 12 1...

6 years ago | 0

| accepted

Answered
How convert for loop to while loop?
A=zeros(5,8); [r,c]=size(A); %for loop i = 0 ; while i<r % loops over rows i = i+1 ; j = 0 ; while j<c % loops o...

6 years ago | 1

| accepted

Answered
how to pass function as argument ??
Read about anonymous functions. f = @(x) 5*x^3-3*x^2+2*x-2 ; Any value can be evaluated using: f(1) f(2)

6 years ago | 0

| accepted

Load more