Answered
How to add (combine) together two structures with the same fields?
clc; clear ; s1.name = 'Tom' ; s1.sex = 'm'; s1.age = 25 ; s2.name = 'Harry' ; s2.sex = 'f'; s2.age = 26 ; % Structur...

5 years ago | 0

| accepted

Answered
I'm plotting a solution to a PDE using surf but the graph turns out wrong?
MAy be you are looking for this: n=1:10 ; tRange = 0:0.05:1; [n,t] = meshgrid(n,tRange); u = (4./(n.^3*pi^3)+(4...

5 years ago | 0

Answered
Adding elements in column vectors
MAke a and b of equal dimension using linspace. and then add. Read about linspace.,

5 years ago | 0

Answered
Plot data with date and time
thedates = datetime(datestr((x))); y = str2double(y) ; plot(thedates,y)

5 years ago | 1

| accepted

Answered
load a folder of excel files
excelFiles = dir('*.xlsx') ; N = length(excelFiles) ; for i = 1:N file = excelFiles(i).name ; T = readtable(file) ;...

5 years ago | 1

| accepted

Answered
Calculate differences between all values elements in a vector and increase max diff by one
A = [2 3 1 4] ; B =[4 4 2 4]; AB = B-A ; [val,idx] = max(AB) ; A(idx) = A(idx)+1

5 years ago | 1

| accepted

Answered
merge duplicate entries and take average associated columns
A=[1 1 1 2 2 3 3 3 4 4 4 2 2 2 3 ]; % B = [ 1 2 3 4 2 3] B= A(diff([0 A])~=0)

5 years ago | 0

Answered
discrete line plot in matlab 2015?
Replace those values with NaN and plot: A =[1 0.122 0.05 0.093 0.113 6 0.18 0.071 0.135 0.168 10 NaN NaN NaN NaN ...

5 years ago | 0

| accepted

Answered
Hello everyone, how to record and save the coordinates of each image centroid point in a matrix in 'for loop'. Thank you very much. The code is as follows:
centroids = cell(numberOfFrames ,1) ; for i = 1:numberOfFrames centroids{i} = s.Centroid; end

5 years ago | 0

| accepted

Answered
my code is not working
Increase the marker size and see. scatter3(xyz(:,1),xyz(:,3),xyz(:,2),10000,rgb,'.');

5 years ago | 0

Answered
How to omit zeros while using mean at varfun?
Convert zero's to NaN and use nanmean.

5 years ago | 0

Answered
Apply image position data to an image (Excel data)
You can check that visually by plotting the dots on the image. I = imread(myimage) ; T = readtable(myexcelfile) ; % assumi...

5 years ago | 0

| accepted

Answered
Extract data from a cell contains of alphabet and number
idx = loc+1 ; iwant = cell2mat(C{idx})

5 years ago | 0

Answered
how to concatenate multiple columns in one column of cell array?
files = dir('*.txt') ; % you are in the folder of files N = length(files) ; T = cell(N,1); for i = 1:N filename ...

5 years ago | 0

| accepted

Answered
Accessing multiple columns in cell array
A = cat(3,Data{:}) ; % convert cell array to 3D matrix m = cell2mat(mean(A(:,end,:))) % mean of last column

5 years ago | 0

Answered
how to write 2 summations
thesum = 0 ; for i = 1:p for j = 1:m thesum = thesum+n(i,j) ; end end

5 years ago | 0

Answered
Is there any way I can access all the surface coordinates of an imported .stl file?
gm = importGeometry(myfile); gm Check the LHS gm it has all the data you want.

5 years ago | 0

Answered
Geoplot with more data than Lat and Lon
Read about scatter. Have a look on mapping toolbox. https://in.mathworks.com/products/mapping.html

5 years ago | 0

Answered
How to find position (indices) of minimum element on each page of 4 dimensional matrix?
You can use the function min to achieve this. Read about it. % demo data using 3D matrix A(:,:,1) = [2 4; -2 1]; A(:,:,2) =...

5 years ago | 0

| accepted

Answered
Plot concentric circle on an image
I = imread('peppers.png') ; [m,n,p] = size(I) ; C = round([n m]/2) ; % center of circle th = linspace(0,2*pi) ; imshow...

5 years ago | 2

| accepted

Answered
read only range of values from csv
You can read the entire data and then pick your required using indexing. data = csvread(myfile) ; % assuming file has single...

5 years ago | 0

Answered
I am looking for drawingmesh
You must get that function with the below book: https://www.springer.com/us/book/9789400789555

5 years ago | 0

| accepted

Answered
the (if statement) condition happens only ones but I want to repeat this if (F Zero) is still not empty
If you are looking for a loop, you may go for while loop. while ~isempty(F_Zero) % Do what you want end

5 years ago | 0

| accepted

Answered
Converting data contained in a cell array into a 4D matrix for input into a CNN for feature extraction
XTrain = cat(3,XTrain{:}) ; XTrain = reshape(XTrain,8,213,1,453) ;

5 years ago | 0

| accepted

Answered
I can't deal with this code.Please help me:)
https://in.mathworks.com/matlabcentral/answers/430515-for-loop-for-fibonacci-series

5 years ago | 0

Answered
find the maximum value of a vector within a defined range
If (t,y) is your data and you want find the max in the range [a b]. idx = y >= a & y <= b ; % get the values lying in [a b] ...

5 years ago | 0

Answered
How to remove a 3d-Surface matrix entries outside of a 2D area/Curve?
You hvae to use inpolygon. Read about it. load('3D_XYZ_Data.mat') ; load('2D_RestrictedArea.mat') ; X = XYZ_Data(:,1) ; ...

5 years ago | 1

| accepted

Answered
if you run F Zero you will get [2 5], I want to delete the column number 2 and 5 from the Matrix W, but the problem is when I'm deleting the columns it deletes number 2 and 6
When you are using a loop the ddimension of W changes and it removes the column in the newly obtained W. You need not to use loo...

5 years ago | 0

| accepted

Answered
Extract xy data from a structure array
You have to do a proper initialization. If you are not aware of dimensions or if dimensions change in loop; go for cell array....

5 years ago | 0

| accepted

Answered
How to replace anomalous 0x0 double elements from a cell array of "character vectors"?
a = [{'A' } {'B' } {0} {'B' } {'C' }] ; idx = cellfun(@ischar,a) ; a(~idx) = ...

5 years ago | 1

| accepted

Load more