Answered
Extracting rows from table with specific digits
code = [{'116004.5'} {'116006.6'} {'120099.9'} {'120199.3'} {'120202.5'}] ; desc...

5 years ago | 1

| accepted

Answered
Loading coordinates from workspace
x = rand(5,1) ; y = rand(5,1) ; z = rand(5,1) ; figure(1) plot3(x,y,z) ; figure(2) scatter(x,y,[],z)

5 years ago | 0

Answered
How can specify interval of variables in fsurf?
f1 = @(x,y) erf(x)+cos(y); x = -5:0.1:0 ; y = -5:0.2:5 ; [X,Y] = meshgrid(x,y) ; Z = f1(X,Y) ; surf(X,Y,Z)

5 years ago | 1

Answered
Sum up values of corresponding date time intervals.
You can find the respective date indices using find or logical indexing. Once you know the first date and last date indices, you...

5 years ago | 0

Answered
How to sum up a column in Matlab?
iwant = sum(T.(4))

5 years ago | 0

| accepted

Answered
how to find the end point coordinates of an object in binary image.?
I = imread('image.png') ; I1 = rgb2gray(I) ; [y,x] = find(I1) ; [idx,C] = kmeans([x y],3) ; imshow(I) hold on plot...

5 years ago | 0

Answered
cell array in cell array
n = length(a) ; iwant = zeros(n,1) ; for i = 1:n iwant(i) = a{i}{3} ; end

5 years ago | 1

Answered
How do I get a graph to spiral
t = linspace(0,10*pi,5000); r = 5. ; c = 4 ; x = r*cos(t) ; y = r*sin(t) ; z = c*t ; comet3(x,y,z) ; plot3(x,y,z,'Color'...

5 years ago | 1

Answered
How to separate the data in the table for loop?
Let C be your cell array. A = cell2mat(C(:)) ; A1 = A(:,1) % first column

5 years ago | 0

| accepted

Answered
Count EVEN and ODD numbers
clc; clear all ; a = input("Please enter 1st number: "); nE = 0 ; nO = 0 ; if mod(a,2)==0 disp("The 1st number is EVEN")...

5 years ago | 1

Answered
How do I create another column in a table which basically divides a T+1 / T number?
x = rand(10,1) ; y = rand(10,1) ; T = table(x,y) T.ratio = T.y./T.x

5 years ago | 0

Answered
Eliminating columns from the matrix
a=[0 12 13;0 5 4;0 9 6;0 8 9] idx = any(a)==0 ; a(:,idx)=[]

5 years ago | 1

| accepted

Answered
Element change in a matrix
Let A be your matrix. B = A ; B(B<30) = 0 ; % replace < 30 to 0 B(B>=30 && B<75) = 1 ;

5 years ago | 1

| accepted

Answered
Subtracts Two Cell Arrays to Yield a Third Array
Let C1 and C2 be two cell arrays of equal size and having same data each cell. N = length(C1) ; iwant = cell(N,1) ; for i =...

5 years ago | 0

| accepted

Answered
Get Two Cell Arrays To Same Size
load typevector_filtered.mat S = size(typevector_filtered{1}) ; for i = 1:length(typevector_filtered) if ~isequal(si...

5 years ago | 0

| accepted

Answered
Can someone help with my syntax error
If A is your array to count number of times a number n (say 5) appears, follow: tol = 10^-5 ; idx = abs(A-n)<=tol ; nnz(idx(...

5 years ago | 0

Answered
Filling in a spherical triangle
Read about delaunayTraingulation.

5 years ago | 0

Answered
Calculate frequency for each gridded
Let A be your matrix/ grid. idx = A<-1 & A>-3 ; A(idx) = 1 ; A(~idx) = 0 ; nnz(A==1) nnz(A==0)

5 years ago | 1

| accepted

Answered
error in plotting graph
Replace the line: plot(tspan,x(:,2),'r',tspan,y_cap(:,2),'b--','LineWidth',2.5) with plot(tspan,x(:,2),'r',tspan,y_cap,'b--'...

5 years ago | 0

| accepted

Answered
how to get complex plot img and real
a = rand(10,1)+1i*rand(10,1) ; % complex number for demo figure plot(a) ; % this will plot real part vs complex part The...

5 years ago | 0

Answered
remove single outliers from vector
x=[ 0 1 1 0 0 0 1 1 1 1 1 0 0 0 0 0 1 0 0 0 1 1 0 0 0 1 0 0 0 0 0 0 1 1 0 0 0 ]; y = [ 0 1 1 0 0 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 ...

5 years ago | 0

| accepted

Answered
Re-arranging row of a matrix in array.
A = [2, 5, -3, 10]; B = [3, 1, 4, 2]; [A,idx] = sort(A) B = B(idx)

5 years ago | 0

| accepted

Answered
How to fix error about interp1?
x = b(:,1) ; y = b(:,2) ; xi = linspace(min(x),max(x),4095)' ; ai_b = interp1(x,y,xi);

5 years ago | 1

Answered
How to sort chunks of data file in descending order
Read the data using readtable and then use function sort.

5 years ago | 0

| accepted

Answered
How can I get a position of a value from an array, and the same position in another array?
You have straight functions to achieve this. REad about ismember and knnsearch.

5 years ago | 0

| accepted

Answered
How to remove image margins
Let I be your image and say you want to extract image from row0 to row1 and col0 to col1.. I_extract = I(row0:row1,col0:col1,:)...

5 years ago | 1

Answered
Combining charts for comparison
if true fig = figure(10); ax = axes(fig); xlabel('\tau'); ylabel(' \Psi(0,\tau)'); title('Injection rate vs. K, C'); h1 = ...

5 years ago | 0

| accepted

Answered
How to keep TRUE if followed by FALSE but if TRUE is followed by TRUE, change the second TRUE to false?
a = round(rand(100,1)) ; b = a ; for i = 2:length(a) if a(i-1)==1 && a(i)==1 b(i) = 0 ; end end

5 years ago | 0

| accepted

Answered
How Do I calculate the Dew Point from the Temperature and Relative Humidity. The equation I need to use is: Td = T - ((100 - RH)/5.)
If X, Z are your Temperature and Relative Humidity arrays, use: Td = X-((100 - Z)/5.) ;

5 years ago | 0

Load more