Answered
ismember and if not working
Please refer to the usage of ismember below, so location of variable A is not correct, On the other hand, rearrange the order o...

4 years ago | 0

| accepted

Answered
How to manage NaN values and calculate mean under conditions
Try the following: summation = sum for each group of data (Each group has 3 data) notnandata = count the number of data which ...

4 years ago | 0

| accepted

Answered
trouble using datetime format in textscan
Detail explanation here: How do I use 'textscan' to correctly read a formatted date?

4 years ago | 0

Answered
append to a table using findgroups and splitapply
Create an empty cell and empty array before the loop. Then create the table after the loop. combinefields={}; ...

4 years ago | 0

Answered
Using the \ operator to fit a parabolic curve to a data set.
use function polyfit with n = 2 p = polyfit(x,y,n) [p,S] = polyfit(x,y,n) [p,S,mu] = polyfit(x,y,n)

4 years ago | 1

Answered
Time and GPS data processing
You may edit the following three variables if you would like to set interval and duration. initialtime = The first reporting ti...

4 years ago | 1

Answered
How to compute thickness of a layer in an image
You can only measure the thickness (or distance) in terms of pixel numbers according to your method. Hence you also need to kno...

4 years ago | 0

Answered
Estimating the period and the damping of the system
This line will give an error: period=time(peaks)-time(peaks(0:size(peaks)-1)) So just try the following: period=time(peaks)-t...

4 years ago | 0

Answered
Convert Number to Time / Duration Format of Data Column
Try the following: clear; clc; [namafile,direktori]=uigetfile({'*.txt', 'Text-files (*.txt)'},'Load Indigo Magnet'); full...

4 years ago | 0

| accepted

Answered
Copy data from cell 1 of file 1 and paste in n cells in file 2
I try to use readcell in my example: Since readcell will read the header as the first row, so what you want to copy becomes the...

4 years ago | 0

| accepted

Answered
Iteratively rename a .txt using writematrix
If you would like to write into a file with path and name as 'C:\Users\...\Matrix_MgO_Substrate.txt', you need to concatenate s...

4 years ago | 1

| accepted

Answered
how to find the difference between first column and second column in a cell array
cellfun(@(x) x(:,1)-x(:,2),C,'UniformOutput',false)

4 years ago | 0

| accepted

Answered
Importing csv files properly
You may use readcell and the output is a cell array. The first row shows the header and the rest of the rows contains the requr...

4 years ago | 0

Answered
How to align headings with array elements
Use sprintf and tab, of course, need some manual adjustment. disp(sprintf('Distance\tLiters Used\tKm/L\tL/100Km')); disp(sprin...

4 years ago | 0

| accepted

Answered
Get horizontal (row) data from a txt file (table) with a reguler-pattern rows (series)
Use readmatrix to retrieve the data in the file as follows: B = readmatrix(full); Data1 = B(1:2:30,1); Data2 = B(1:2:30,5); ...

4 years ago | 0

| accepted

Answered
extracting the last three characters from cell array
Use cellfun to retrieve the last three charaters FileNameinCell=cellfun(@(x) x(end-2:end), FileName, 'UniformOutput', false) F...

4 years ago | 0

| accepted

Answered
Calculate normals to an irregular curve at the intersection points with a line
For function 'intersections', you can output the vector 'jout' which is the location of the intersecting points on the segments....

4 years ago | 0

| accepted

Answered
Apply my calculation for all data file
Add a for loop for each file as follows: for k = 1:numel(N) baseFileName = N{k}; %for k = 1 : length(theFiles) %...

4 years ago | 0

Answered
How to compare peaks of two sinusoidal plots
Use function islocalmax and islocalmin, but it requires lots of observation from the previous figures in order to get a correct ...

4 years ago | 0

Answered
How do I filter time data from excel columns, where the values are numerical and the columns are character named?
Better to look at the usage of those data import function used in MATLAB. I use readcell in this case. rawdata=readcell('RES_I...

4 years ago | 0

| accepted

Answered
How can I extract data from the gps log?
Is it ok the result in a cell array? If yes, you may try the following: Noticed that some of your data does not have the secon...

4 years ago | 1

Answered
List of Node pairs
Basically you just want to create the matrix, right? u=1:4; u_entend = repelem(u,1,length(u)-1); w = repmat(u',1,length(u)); ...

4 years ago | 0

Answered
Creating a vector using conditions and a cell.
Try this: Zeros in the matrix means all conditions are not meet actid=(Ay>10) + (Ay>5 & Ay<7.5)*2 + (Ay<10 & Ay>9)*3 + (Ay<1 &...

4 years ago | 0

| accepted

Answered
Replace matrix entries with entries from another matrix
I do it in a cell array: clear; clc; A = [0 0 0 0 0; 0 0 0 0 0; 0 0 0 0 0]; B = [1 1 1;2 2 2;3 3 3]; combine = [A,B]; idx =...

4 years ago | 0

| accepted

Answered
How do I solve imnoise error when inserting variables that store the single English alphabet and its background respectively which are logical image(which are binary image)??
Newforegnd & background are BW image which is class logical and imnoise does not support. You may change it to class double or ...

4 years ago | 1

| accepted

Answered
Could anyone help me how to solve the issue in the code as attached
If I understand correctly, try this: A = arrayfun( @my_rand, repelem((1:3).',5), 'UniformOutput', false); B = cellfun(@(x) re...

4 years ago | 0

Answered
Hi everyone! Please I need some help with batch importing a bunch of xml file files I have in a folder into my workspace. I tried to use xml2struct but it only gets one
Try to add the indexing for variable 'data' and each file name for i=1:length(file_list) data(i)=xml2struct(file_list{i}) ...

4 years ago | 0

| accepted

Answered
Largest rectangle inscribed inside multiple blobs
How about separate them into 6 different images and put into the function? The images are stored in BW(:,:,1) to BW(:,:,6). A ...

4 years ago | 0

| accepted

Answered
Matching matrices based on two columns
col=size(A,2); row=size(B,1); C = nan(row,col); [~,idx] = ismember(B,A(:,2:3),'rows'); idx2=find(idx~=0); ...

4 years ago | 1

| accepted

Answered
Multipying each element of a matrix with average of elements in other matrix
Try this: [Ny,Nx]=size(A); [X,Y]=meshgrid(1:Nx,1:Ny); w = (B(X)+B(Y))/2; C = A.*w

4 years ago | 0

| accepted

Load more