Beantwortet
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...

fast 5 Jahre vor | 0

| akzeptiert

Beantwortet
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 ...

fast 5 Jahre vor | 0

| akzeptiert

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

fast 5 Jahre vor | 0

Beantwortet
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={}; ...

fast 5 Jahre vor | 0

Beantwortet
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)

fast 5 Jahre vor | 1

Beantwortet
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...

fast 5 Jahre vor | 1

Beantwortet
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...

fast 5 Jahre vor | 0

Beantwortet
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...

fast 5 Jahre vor | 0

Beantwortet
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...

fast 5 Jahre vor | 0

| akzeptiert

Beantwortet
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...

fast 5 Jahre vor | 0

| akzeptiert

Beantwortet
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...

fast 5 Jahre vor | 1

| akzeptiert

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

fast 5 Jahre vor | 0

| akzeptiert

Beantwortet
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...

fast 5 Jahre vor | 0

Beantwortet
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...

fast 5 Jahre vor | 0

| akzeptiert

Beantwortet
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); ...

fast 5 Jahre vor | 0

| akzeptiert

Beantwortet
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...

fast 5 Jahre vor | 0

| akzeptiert

Beantwortet
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....

fast 5 Jahre vor | 0

| akzeptiert

Beantwortet
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) %...

fast 5 Jahre vor | 0

Beantwortet
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 ...

fast 5 Jahre vor | 0

Beantwortet
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...

fast 5 Jahre vor | 0

| akzeptiert

Beantwortet
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...

fast 5 Jahre vor | 1

Beantwortet
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)); ...

fast 5 Jahre vor | 0

Beantwortet
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 &...

fast 5 Jahre vor | 0

| akzeptiert

Beantwortet
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 =...

fast 5 Jahre vor | 0

| akzeptiert

Beantwortet
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 ...

fast 5 Jahre vor | 1

| akzeptiert

Beantwortet
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...

fast 5 Jahre vor | 0

Beantwortet
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}) ...

fast 5 Jahre vor | 0

| akzeptiert

Beantwortet
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 ...

fast 5 Jahre vor | 0

| akzeptiert

Beantwortet
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); ...

fast 5 Jahre vor | 1

| akzeptiert

Beantwortet
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

fast 5 Jahre vor | 0

| akzeptiert

Mehr laden