Answered
how to read first lines of a txt file and omit first text lines and take the numbers data from text data as a separate columns
Read about textscan with headerlines option. fid = fopen('data.txt','r') ; S = textscan(fid,'%f, %f %f,%f','HeaderLines',7...

7 years ago | 0

| accepted

Answered
How to fix interp2() error?
image = imread('Image1.bmp','bmp'); image = double(image) ; V = image(1:3:end,1:3:end); Vq = interp2(V,2);

7 years ago | 1

Answered
Creating a cell and allocation specific text
result = cell(1,length(beta)); result{1,1} = {'Intercept'}; result_aux = sprintfc('X%d', 1:41); legend{1,2:end} = legend_aux;...

7 years ago | 0

Answered
Following is the error while calculating cosine distance
cell is accessed using flower braces i.e {}. Replace Distance(ctr) with Distance{ctr}. function Distance = CosineDistance(Clien...

7 years ago | 0

| accepted

Answered
give classes different marker colour and change fontsize of markers
x =[ -0.0096 0.0145 0.0173 0.0207 -0.1068 -0.0997 0.0289 0.0020 -0.0033 0.0002 0....

7 years ago | 0

| accepted

Answered
how interpolate 3d points
Read about gridata and scatteredInterpolant.

7 years ago | 0

| accepted

Answered
how to make 2d lookup table when having 3 vectors
Let t,f,c be your torque, flux and current vectors respectively. F = scatteredInterpolant(t,f,c) ; ci = F(ti,fi)

7 years ago | 0

| accepted

Answered
How to group a data set based on the ranges using machine learning techniques?
Using knnsearch [num,txt,raw] = xlsread('data.xlsx') ; N = length(num) ; C = cell(N,1) ; C(num<10) = {'Low'} ; C(num>=1...

7 years ago | 1

| accepted

Answered
How to find the dimensions of a specific area in an existing image?
In that case......the length of unique of x,y should give you the dimensions. You have numGreenPixels as a matrix of 0 and 1's. ...

7 years ago | 0

Answered
how to map an point of a grid onto the nearest point of that point on another grid
Read about knnsearch https://in.mathworks.com/help/stats/knnsearch.html

7 years ago | 0

Answered
Matching pair to some reference value
tol = 10^-6 ; idx = abs(B-A)<=tol ; [A B(idx')]

7 years ago | 0

Answered
How do I plot a horizontal line
s=0.5:0.001:1; f=repmat(0.25,1,length(s)); plot(s,f)

7 years ago | 1

| accepted

Answered
Setting threshold on a matrix
Let A be your m*3 matrix. A(A(:,3)<=0.092,:) = [] ; % remove rows from A where third column is less than or equal 0.092

7 years ago | 0

Answered
How do I get specific data using inpolygon in Matlab?
Refer this for demo: https://in.mathworks.com/matlabcentral/answers/454295-how-to-pick-the-points-in-meshgrid-within-a-outline

7 years ago | 0

Answered
How to solve error "Index exceeds the number of array elements (1)."?
myPitches = [500, 1000, 1500, 2000, 2500]; condition_fs = [1 2 3 4 5]; howLong = .5; presentedPitches = []; for condition = ...

7 years ago | 0

Answered
syntax for random number
a = 50; b = 500; r = (b-a).*rand(10,1) + a; Read here: https://in.mathworks.com/help/matlab/math/floating-point-numbers-withi...

7 years ago | 0

Answered
Delete specific contour line from contour plot
You can read about the option of LevelList in the countour. YOu can provide only those levls which you want to plot. Read more i...

7 years ago | 1

Answered
load files automatically and combine
YOu should try some thing like below. It should work, if any error let me know. files = dir('*xlsx') ; N = length(files) ; ...

7 years ago | 0

| accepted

Answered
Is it possible to eliminate a color range from certain colormap?
Z = peaks(100) ; figure(1) pcolor(Z) cmap = hsv ; colormap(cmap) % Remove red idx = cmap(:,1)==1 ; cmap(idx,:) = [] ; ...

7 years ago | 0

Answered
Finite Element 3D post-processing
https://in.mathworks.com/matlabcentral/fileexchange/32719-postprocessing-in-fem Te above shall help......if not attach your da...

7 years ago | 0

Answered
How to create nc file having lat, long, time, and 2D matrix
Refer this demo example: % nc filename to be written file = 'myfile.nc' ; %% Write lon and lat variables % Get data lo...

7 years ago | 2

| accepted

Answered
How to draw a stretchable polygon on an image?
https://in.mathworks.com/help/images/ref/imrect.html

7 years ago | 0

Answered
Size function regarding image
I = imread('peppers.png') ; [nx,ny,nt] = size(I) If your image is RGB, in the baove nx,ny,nz gives number of rows, columns an...

7 years ago | 0

Answered
Extracting data for only one season from a NetCDF file.
Read about ncread. FIrst read the time data.......pick the required time using datevec / datetime/ datestr. Once you have indic...

7 years ago | 0

Answered
How can I read a MATLAB .m file?
YOu need not to read it....simply run the m file....you have data in hand.

7 years ago | 0

Answered
How can I rotate the following cube in real time?
X = [0, 4, 4, 0 0, 4, 4, 0 0, 0, 0, 0 0, 4, 4, 0 4, 4, 4, 4 4, 4, 0, 0] ; Y = [0, 0, 3, 3 0, 0, 3...

7 years ago | 0

| accepted

Answered
can anyone help to solve this
It is a straight away demo in documentation. https://in.mathworks.com/help/images/ref/regionprops.html

7 years ago | 0

Answered
help me to understand this line
plot(1:10,rand(1,10),'k-o',1:10,rand(1,10),'k-s') Read about plot. k-o, k-s stand for markers...they say plot a line (-) with c...

7 years ago | 0

| accepted

Answered
How to pick the points in meshgrid within a outline?
inpolygon is celeberated function here. X = [0 2 2 4 4 5 5 3 3 0 0 1 1 0]; Y = [0 0 1 1 0 0 7 7 5 5 3 3 1 1]; del = 0.1;...

7 years ago | 1

| accepted

Answered
Plotting Displacement, Velocity and Acceleration vs. Time
function Myfunction() %% @ Jeanette M. Sarra, CE 165 %Newmark-Beta Method %% Given Values clear all; clc; close all; elce...

7 years ago | 1

| accepted

Load more