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

2일 전 | 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...

2일 전 | 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...

2일 전 | 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...

3일 전 | 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(:,...

4일 전 | 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. ...

5일 전 | 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 ...

5일 전 | 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...

5일 전 | 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...

6일 전 | 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))...

9일 전 | 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 ...

9일 전 | 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...

10일 전 | 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)....

10일 전 | 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>

11일 전 | 1

답변 있음
How to create a custom grayscale colormap between white and black?
You may use 'colormapeditor' as follows to create a custom colormap:

13일 전 | 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')

13일 전 | 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...

14일 전 | 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...

14일 전 | 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))

15일 전 | 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...

15일 전 | 0

| 수락됨

더로드