Community Profile

photo

Simon Chan


Hospital Authority

2021 以来アクティブ

Statistics

  • Pro
  • 6 Month Streak
  • Knowledgeable Level 4
  • First Answer

バッジを表示

Content Feed

表示方法

回答済み
Smoothed 2D histogram contour
Try this: data = readmatrix('xy.xlsx'); nbins=[200 200]; % You may adjust number of bin...

1日 前 | 0

回答済み
Release a Message in GUI to user when calculation can't be performed
A sample example as follows, you may modify it to suit your purpose: A = [1 2 3 4; 2 3 4 5]; B = [3 4 5; 4 5 7]; fig = uifigu...

1日 前 | 0

| 採用済み

回答済み
Calculating percentage of brown pixels over other colors in tumor
Define the tumor roi and then calculate the white pixels inside the roi: clear;clc; rawdata=imread('image.png'); BW = rgb2gra...

1日 前 | 0

| 採用済み

回答済み
How can I make right axis off in Matlab plot?
Use function yyaxis and hide the right y-axis as follows: clear; clc; h = figure(1); hax = axes; y=randi(100,1,10); grid on...

1日 前 | 0

回答済み
how can i correct this code and get rid of error? urgent help please
You need to specify the number of digits after the decimal point. For example, %.2f or %.4f for 2 and 4 digits after the deci...

2日 前 | 0

回答済み
Assigning NaN to variables, inserting into a cellarray and then plotting Error
Suppose variable A is the data in your uitable. You may use function str2double B = str2double(A); Then plot it using B(:,...

3日 前 | 0

| 採用済み

回答済み
MATLAB function gives me error
Check the length of variable 'u'. Looks like there is only 1 element inside variable 'u', but the function request to find the ...

4日 前 | 0

| 採用済み

回答済み
binary matrix to decimal number
Try this: A = logical([1 0 1 1 0 0 1 0]); B = bin2dec(num2str(A))

4日 前 | 1

回答済み
How to sum values in a matrix which are in the specified distance from one value?
You may try the following where the mask indicates the pixel where its distance is 50 pixels from your preset center pixel. ...

4日 前 | 0

回答済み
Dot indexing is not supported error
If there exist a variable name mat_files.name, you are not allowed to use another variable with name mat_files. You may need ...

4日 前 | 0

回答済み
How to add a column to a UItable in AppDesigner
I think it is better to record the number of columns in the uitable before you added a new column and assign the name to the new...

4日 前 | 0

回答済み
Y data on the bar plot
Why not using the example in the documentation by getting the EndPoints as follows: clear; clc; x = [25 50 75]; vals = [6000...

5日 前 | 1

回答済み
Why won't this function plot?
No need to use the for loop, Just use the following: plot(c1_exp)

6日 前 | 0

回答済み
how to fit ylabel for the plots?
You may also experiment with the InnerPosition of 'gca'. Following shows an example: Nz = 100; A = randi(100,1,Nz); figure(...

6日 前 | 0

回答済み
plotting Y data on scatter plot
Another option as follows: for i = 1:6 text(X(i),Y(i),sprintf('(%.0f)',Y(i))) end

7日 前 | 0

| 採用済み

回答済み
how to convert dicom RT structure to binary mask
It uses world coordinates in x,y & z axis which is shown in your attached png file. So you need to capture the axis information ...

8日 前 | 0

回答済み
How to plot unequal time series with same x-axis
You may try the following: T = readtable('data.csv'); % Read csv file as entire table TT2 = table2timetable(T(:,4:5))...

8日 前 | 0

| 採用済み

回答済み
How to iterate matrix multiple times?
Write your code as a function and save it as a m-file (or use the attached file): function Lj = processLa(La) H = [1 1 1 ...

8日 前 | 1

回答済み
Can anyone help me?
Varaible a becomes a character array after you use function num2str, so it is comparing a 'character' instead of a number. On t...

9日 前 | 1

回答済み
How to I find the intersection point between y=x*exp(x)/(exp(x)-1) and y=3? I can't seem to have the intersection point displayed.
Use function fzero to help you to find the intersection. x = 1:1:10; f = @(x) x.*exp(x); g = @(x) exp(x)-1; y_1 = @(x) f(x)....

9日 前 | 0

回答済み
How to check in one loop for multiple values V1,V2,V3... I have write the code but I am not getting value multiplied in answer
One possible way is to use a cell array instead of different variables as following: Use only one variable V. V(1) = {char(937...

10日 前 | 0

| 採用済み

回答済み
Creating an Image from a Textfile Data using Matlab
Try the followings: (with editing below) Normalization just divide by 255 for uint8 image. [Ny,Nx,Nc] = size(input_image_3D); ...

10日 前 | 0

| 採用済み

回答済み
Superimposing Graphs with large difference in Y-axis values
Try function <https://www.mathworks.com/help/matlab/ref/yyaxis.html yyaxis>

10日 前 | 1

回答済み
How to create a custom grayscale colormap between white and black?
You may use 'colormapeditor' as follows to create a custom colormap:

12日 前 | 0

| 採用済み

回答済み
plot in logarithmic scale
I think you may need to use function contour3. Then you can set the Z-axis scale to log by set(gca,'ZScale','log')

12日 前 | 0

回答済み
changing dicom-dict.txt has no effect
You may refer to the following and try to create a new DICOM tag and write it to a new DICOM image. After that, the DICOM heade...

13日 前 | 0

回答済み
What would be the MatLab code to get the output from the input image?.
Try the following: rawdata = num2cell((randi(10,10,4))); index = [2 2 2 1 2 3 4 2 1 2]'; singlecell = cellfun(@(x,y) x(y), nu...

13日 前 | 0

回答済み
How can I save the result obtained from the For loop in one variable ?
You may assign another variable with index which stores the result within the loop for i = 1:10 %.... %.... [centers, r...

14日 前 | 1

| 採用済み

回答済み
How to convert cell to matrix
Try this, where A is your 100001x2 cell: cell2mat(cellfun(@(x) x,A))

14日 前 | 0

回答済み
How can I skip data while reading values from text file?
I try to use function fgetl as follows: Noticed that the first 2 rows have data format different from others, so they are remov...

14日 前 | 0

| 採用済み

もっと読み込む