Community Profile

photo

Simon Chan


Hospital Authority

Active since 2021

Statistics

  • Knowledgeable Level 3
  • First Answer

View badges

Content Feed

View by

Answered
how to use setvartype on a table that is already existing
Please refer to the following example without using setvartype. (1) When you create the table, you can create the preset varia...

ungefär 2 timmar ago | 0

Answered
printing a table made of 3 arrays
You can write the entire table to excel using the following code: However, please make sure that they are all column vectors an...

ungefär 5 timmar ago | 0

Answered
"Index exceeds matrix dimensions" error during performing RGB channel separation
According to your code shown above, variable I is only a file name in the beginning of the for loop. Have you do imread or some...

ungefär 6 timmar ago | 0

Answered
dicominfo returns an error on all dicom files other than one
Below shows some modification based on your code: (1) Variable all_list is going to contain file names only, so that the index ...

ungefär 6 timmar ago | 1

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

en dag ago | 0

| accepted

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

en dag 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);

2 dagar 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_...

2 dagar ago | 1

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

2 dagar 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

2 dagar ago | 0

| accepted

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

3 dagar ago | 2

| accepted

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

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

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

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

| accepted

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

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

5 dagar 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)

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

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

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

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

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

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

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

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

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

8 dagar 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); ...

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

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

8 dagar ago | 0

| accepted

Load more