Answered
Load Map text file with X and Y coordinates, want to plot those coordinates and plot the vehicle dimensions inside the plot
T = readtable('M1_layout.txt') ; pos = [T.(2) T.(3)] ; plot(pos(:,1),pos(:,2),'.r')

5 years ago | 1

Answered
I want to generate Heatmap for irregular Time series data
T = readtable('dat.csv') ; x = T.(1) ; x(1) = [] ; x = datetime(datestr(x)) ; y = table2array(T(1,2:end)) ; data = tabl...

5 years ago | 0

Answered
Reading data from google spreadsheet
Read about webread. https://in.mathworks.com/help/matlab/ref/webread.html

5 years ago | 0

Answered
How to specify a row and column in an array
A = rand(5,80) ; iwant = A(1,1)-A(2,1) What you tried: u1 = u(1,:1); :1 is not valid. Simply you need to index bu u(r,c). ...

5 years ago | 0

Answered
How do I use if elseif to find indices of elements that meet a statement and assign NaN to elements that don't?
If a is your matrix, to replace the values which are less than -0.1 just use: idx = a < -0.1 ; a(idx) = NaN ;

5 years ago | 0

Answered
How can I use nested loops to pair one piece of data with multiple other pieces?
a = rand(1,3) ; b = rand(1,5) ; [B,A] = meshgrid(b,a)

5 years ago | 1

| accepted

Answered
How to mean all array?
A = [0 1 1; 2 3 2; 1 3 2; 4 2 2] ; iwant = mean(A(:))

5 years ago | 0

| accepted

Answered
splitting 2 rows of excel using matlab
T = readtable(myfile) ; % excel file with extension n = height(T) ; for i = 1:n fname = strcat('row',num2str(i),'.xlsx'...

5 years ago | 0

Answered
Turn off the plot of findpeaks function
You might be simply using the function findpeaks with data as input. Take the output. data = [25 8 15 5 6 10 10 3 1 20 7]; fi...

5 years ago | 0

| accepted

Answered
How to replace some Number in row matrix with NaN
Y = [5 7 18 16 40 18 9 32 15 4 9 60 40 24 10 13]; Y_new = [5 7 18 16 NaN 18 9 NaN NaN 4 9 NaN NaN NaN 10 13]; dY = diff([...

5 years ago | 0

Answered
How to do iteration?
Lch=[-22.5971212295960 29.9076428426283 -17.3150512249935 16.1986770081474 -29.0533677411566 39.4388257818327 -23.4478195797575 ...

5 years ago | 0

Answered
nearest neighbour, bilinear, and bicubic interpolation
There are already inbuilt functions available for this; read about interp2.

5 years ago | 0

| accepted

Answered
Open and procces multiple images
Img = dir('*.png') ; % give your extension of images N = length(Img) ; for i = 1:N thisImg = Img(i).name ; I = i...

5 years ago | 0

Answered
Imaginary parts of complex X and/or Y arguments ignored
plot(i, lambda); The above line is not correct. LAst lines should be repalced with. H=B./mu; figure (2) plot (H,B); xlabel...

5 years ago | 0

Answered
Define time interval for wave of highest peak
Use the function max, it will give maximum value along with the index of the maximum value; using this index you can get the res...

5 years ago | 0

Answered
What is difference between corrcoef([A B]) and corrcoef(A, B)?
Both are same and result into same answer. A = randn(60,1); B = randn(60,1); R1 = corrcoef(A,B) R2 = corrcoef([A B])

5 years ago | 1

| accepted

Answered
Dividing image into grid - imwrite breaks when processing an empty image
Error is clear right..it seems there is no data in ca{r,c} in the case when error pops. Keep a check whether data is empty or no...

5 years ago | 0

| accepted

Answered
How to smoothen curves?
load('data') x = data(:,1); y = data(:,2:end); figure(1), plot(x, y,'r'); yi = zeros(size(y)) ; for i = 1:size(y,2) ...

5 years ago | 1

Answered
Get values of workspace with same matrix format.
You can simply use B(:); this will always give the result as column matrix. If you want to use if, else if size(B,1)==1 fp...

5 years ago | 0

Answered
How do I separate negative datas with their row?
Let H be your third column. idx = H<0 ; % get all negative values logical indices lon1 = lon(idx) ; lat1 = lat(idx) ; H1...

5 years ago | 0

| accepted

Answered
Find intersection points between lines
You can consider using this file exchange to find the point of intersections. https://in.mathworks.com/matlabcentral/fileexcha...

5 years ago | 1

| accepted

Answered
Plotting for loop with two outputs
X= 2:1000000; n = length(X) ; L = zeros(1,n) ; for i = 1:n L(i) =HW32P12Function(X(i)); end figure(1) loglog(X,L) ...

5 years ago | 0

| accepted

Answered
How can I draw and descretize(into grids or mesh) this domain in 2D.
You can use transfinite interpolation. Refer the below examples: https://in.mathworks.com/matlabcentral/fileexchange/40618-gri...

5 years ago | 2

| accepted

Answered
Find min and max values in a constant interval.
If A is your complete matrix. t = A(:,1) ; % this is seconds column iwant = A(t==30,:) ; % extract chunk which is for 30 ...

5 years ago | 0

Answered
How to fix the Dot indexing is not supported for variables of this type error?
Replace (i.j) with (i,j). There is . (dot) between i and j; replace it with comma. it seems a typo error.

5 years ago | 1

Answered
Plot3 to import data from Excel
T = xlsread('calculations.xlsx') ; plot(T(:,1),T(:,2:end))

5 years ago | 0

Answered
How to save the values of (x,C) in file 1 and (x,y) in file 2 to plot them in file 3.. the description in the code below
% file 1 clc; clear; x=[1 3 2 5 8] ; C = zeros(10,length(x)) ; for i=1:10 C(i,:)=i*x; end writematrix(C,'file1.txt...

5 years ago | 0

| accepted

Answered
how to find specific value in a table?
idx = hsl.clusternya==3 ; % logical indexing T(idx,:)

5 years ago | 1

| accepted

Answered
If statement to target certain area of f(i,j)?
% Subroutine function k=X(x,y,dx) if (x <=5 && y <=2) || (x >= 10 && y >= 10) constant = 85; % beta else constant ...

5 years ago | 0

| accepted

Answered
help --- symbolic expression or function
syms x y z one = 3*x +2*y - z == 10; two = -x + 3*y + 2*z == 5; three = x -y - z == -1 ; s = solve({one,two,three},x,y,z) ; ...

5 years ago | 1

Load more