Answered
How can I surface plot a 1000x2 matrix?
A = randn(1000,2); hist(A(:)) hist(A)

5 years ago | 0

| accepted

Answered
How to find the position of a number in an cell-array?
P= {[2,5], [3], [], [1,14], [], [9]} ; N = length(P) ; val = 14 ; for i = 1:N idx = ismember(14,P{i}) ; if any(i...

5 years ago | 0

| accepted

Answered
count number of rows in csv outside of matlab
csvFiles = dir('*.csv') ; N = length(csvFiles) ; f = cell(N,1) ; % first row l = cell(N,1) ; % last row for i = 1:N ...

5 years ago | 0

Answered
Creating a 3D graph of many 2D-view surface plots
On using contour, you will get the points/ locations (x,y).... do interp2 and you will get the respective z values......do the s...

5 years ago | 0

Answered
How to create a netcdf in matlab which can be read by grads without using descriptor file?
% nc filename to be written file = 'myfile.nc' ; %% Write lon and lat variables % Get data lon = 1:10 ; lat = 1:10 ; nx ...

5 years ago | 0

Answered
Finding matching points between two 2d point sets, but different sizes
Read about knnsearch.

5 years ago | 0

Answered
Eigen Vectors and Values using Matlab
A=[4 6 2;6 0 3;2 3 -1]; lambda=eig(A) syms l eqn = det(A-l*eye(3))==0 ; solve(eqn,l) ; l = double(vpasolve(eqn,l))

5 years ago | 0

Answered
Insert certain percentages of missing values in a dataset
A = rand(600,10) ; % demo data N = numel(A) ; % number of elements idx = randperm(N,10/100*N) ; % get 10% of data indi...

5 years ago | 2

| accepted

Answered
How to link lat/lon to a variable based on time?
load ABdatasets.mat ; % Remove NaN's from B_time idx = isnan(B_time) ; B_time(idx) =[] ; B_reflectance(idx) =[] ; A_reflec...

5 years ago | 0

Answered
Cell to mat conversion
iwant = reshape(cell2mat(a),[],length(a))' ; iwant(1,:)

5 years ago | 1

Answered
How to count sum for values corresponding to repeated numbers in matrixes.
clc; clear all ; data = [9170 1 1 9443 2 14 9443 4 14 9443 8 14 15872 4 12 15...

5 years ago | 0

| accepted

Answered
Can anyone help me figure out the preallocation of the unknown matrix which no. of rows changing in every cycle? Thank in advance
close all; clc; tic p=dir('*.txt'); nFiles=numel(p); A_cat=cell(nFiles,1); % A_cat=zeros(500000,30); for k=1:nFiles A...

5 years ago | 0

| accepted

Answered
How to find the indices of elements in an array?
A = rand(100) ; [val,idx] = min(A(:)) ; [i,j] = ind2sub(size(A),idx) ; val A(i,j)

5 years ago | 0

Answered
MAKING A SCATTER PLOT BASED ON INDEX VALUES
[C,ia,ib] = unique(column1) ; % column1 is your column idx = zeros(size(column1)) ; % make indices to save each class fo...

5 years ago | 0

| accepted

Answered
How to draw a 3D plot from an excel data?
num = xlsread('test3.xlsx') ; x = num(2:end,1) ; y = num(1,2:end) ; Z = num(2:end,2:end) ; surf(x,y,Z')

5 years ago | 1

| accepted

Answered
Plotting 3D data
load('Error_matrix.mat') x = Error_matrix(:,1) ; y = Error_matrix(:,2) ; z = Error_matrix(:,3) ; xi = unique(x) ; nx =...

5 years ago | 1

| accepted

Answered
calculating sum of integers
n = 123456789; iwant = sum(num2str(n) - '0')

5 years ago | 0

| accepted

Answered
how to plot ?
Read about pcolor, surf. [X,Y,Z] = peaks(50) ; figure surf(X,Y,Z) figure pcolor(X,Y,Z)

5 years ago | 1

| accepted

Answered
write a matlab program to plot signal xt=sin t+sin 2t+sin 3t+…
This is a very simple homework/ exercise; which you are supposed to do. Read about linspace, plot. Read about the function sin. ...

5 years ago | 0

Answered
Plot specific coloured dots
Read about gscatter. Also you can use plot with 'Markercolor' mentioning.

5 years ago | 1

| accepted

Answered
how to merge the data in a table into one column
A = rand(4,3) ; A(end,:) = [] ; % delete last row A = A(:)

5 years ago | 0

Answered
color the surface of each triangle considering the RGB value
Try this package: https://www.mathworks.com/matlabcentral/fileexchange/25555-mesh2d-delaunay-based-unstructured-mesh-generation ...

5 years ago | 0

Answered
plot multiple rectangles/circles in the same frame, hold on
To plot them you can specify the centers and use markers, increase the size of markers. Have a look on plot.

5 years ago | 0

Answered
how to code surf graph?
x = 0:0.01:0.2 ; nx = length(x) ; y = 0:0.01:0.2 ; ny = length(t) ; [X,Y] = meshgrid(x,y) ; Z = reshape(z,nx,ny) ; ...

5 years ago | 2

| accepted

Answered
Comparison of symbolic expressions
syms a b c = a+b ; d = b+a ; isequal(c,d)

5 years ago | 0

Answered
How to plot streamline for velocity data??
https://in.mathworks.com/help/matlab/ref/streamline.html

5 years ago | 0

Answered
Area under a hysteresis curve
Yes yoou can use trapz. Other option is, arrange the coordinates of curves into a closed polygon and use polyarea.

5 years ago | 0

| accepted

Answered
Error using textscan when I try to plot from text file
data = importdata('test50000.txt') ; data is a array of dimensions 12371x23. Next what?

5 years ago | 0

Answered
How to vectorize the following code snippet?
x = -1.0:0.2:1.0; y = -2:0.25:3; [X,Y] = meshgrid(x,y) ; result = exp(X.^2-Y.^2);

5 years ago | 0

| accepted

Load more