Community Profile

photo

Simon Chan


Active since 2021

Statistics

  • Knowledgeable Level 3
  • First Answer

View badges

Content Feed

View by

Answered
Legend option and numbering in boxes
Try the following: y1 = [85 83 82 87; 81 79 84 86; 82 81 89 87; 89 85 87 80; 90 91 85 87]; figure(1), b = bar(y1,'stacked');...

etwa 10 Stunden ago | 0

Answered
How To Extract Data from Multiple CSV Files and Run Analysis?
Read files and use readtable to retrieve the data into a cell array. The first row of the csv file contains the headers but rea...

etwa 11 Stunden ago | 0

Answered
How can I visualized the multiple tables read from a for loop in the variable space?
Use cell array instead: variables{i} = table(dataArray);

etwa 17 Stunden ago | 0

| accepted

Answered
How to store and reuse coefficients in a for loop
The loop of finding the coefficient can be entirely replaced by: new_coeff = permute(f_n_m,[2 3 1]); Noticed that size of new_...

etwa 19 Stunden ago | 0

Answered
Hold on not working in for loop for imshow
It just executing too fast and not able to observe from the screen. You may add a pasue and try to see whether the output is wh...

etwa 22 Stunden ago | 0

| accepted

Answered
Make a new a directory and save a file in a loop
use the following for saving data into a file. save(fullFileName, 'plotvars'); % plot vars is the variable I want to save

etwa 24 Stunden ago | 0

Answered
What does cyan marker indicate in the editor
Check this: Editor Bookmarks

ein Tag ago | 2

| accepted

Answered
nanmean and mean ( 'omitnan') error
use mean(cell2mat(PAR_1),'omitnan')

ein Tag ago | 0

| accepted

Answered
Finding X,Y coordinates after image rotation
The following code is going to check the coordinates and not replacing your code, so you may need to verify you code based on th...

ein Tag ago | 0

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

ein Tag 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 ...

2 Tage ago | 0

| accepted

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

3 Tage 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 Tage 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 Tage 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 Tage ago | 0

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

5 Tage 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...

5 Tage 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...

5 Tage 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...

6 Tage 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)

6 Tage 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...

6 Tage 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...

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

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

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

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

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

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

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

8 Tage ago | 1

Load more