Answered
How to convert 3D to 4D images
Try thw following: [filename,pathname]=uigetfile('*.dcm','Select Files', 'MultiSelect', 'on'); Nz = length(filename); for k =...

4 years ago | 0

| accepted

Answered
resampling data into equal intervals
Try function retime TT1=readtimetable('dataset.txt'); TT2 = retime(TT1,'secondly','linear'); % You may choose other metho...

4 years ago | 0

| accepted

Answered
dicominfo to filesnames in a cell
Replace the following line infos = cellfun(@dicominfo, filenames); with this one: infos = cellfun(@(x) dicominfo(x,'UseDictio...

4 years ago | 0

Answered
How do i find repeating sample with different value in data and replace the value with its average?
Try this: T = table(data(:,1),data(:,2),'VariableNames',{'Energy','mass_attentuation_coefficient'}); G = groupsummary(T,"Energ...

4 years ago | 0

| accepted

Answered
Erase vectors within a certain area on quiver plots
Find all points inside the semi-circle and set NaN to those points on vector u and v. clear;clc; U = 5; a = .01; X = -.03:.0...

4 years ago | 2

| accepted

Answered
Transparent background for figures to make a movie
Try using function pcolor so that you can adjust the FaceAlpha value. I = imread('image.png'); [Ny,Nx,Nz]=size(H); [X,Y]=mesh...

4 years ago | 0

| accepted

Answered
How to plot grouped stacked bar plot in matlab
Try this: data = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/886550/data.xlsx'); G = groupsummar...

4 years ago | 0

| accepted

Answered
Is it possible to make a surface perfectly proper?
You may adjust the value of variable 'spacing' in the following code to meet your needs. I use spacing = 5 as an example, you m...

4 years ago | 0

Answered
Measuring percentage of black pixels
Try the following: Variables 'dark_number' and 'dark_percent' reports the number and percentage of black pixels in each ROI res...

4 years ago | 0

Answered
Storing fewer decimal places in an array to display using a uitable
Change the number to a string by using function sprintf as follows: uit1 = uitable(uif,'Position',[5 155 500 100]); uit1.Data ...

4 years ago | 0

| accepted

Answered
I want to fill color in the circle
Add these 2 lines after your polar command: set(polar(th,r1,'-k'),'LineWidth',1.1); [xx,yy]=pol2cart(th,r1); fill(xx,yy,'r') ...

4 years ago | 0

| accepted

Answered
How to make summation of moved and fixed matrix ?
Not sure it is efficient or not, just an optional way of doing it: load('A1.mat'); load('A2.mat'); s1 = regionprops(bwareafil...

4 years ago | 0

Answered
How to deal with NaN in 3D interpolation problems?
You may refer to the following function in MATLAB FileExchange: Inpainting nan elements in 3-d

4 years ago | 0

Answered
How to copy axes to a tiled figure?
Try the follwoing to see whether this is what you want. It generate 6 pdf files from 6 plots. x = 1:20; y = randi(100,6,20); ...

4 years ago | 0

Answered
Index in position 1 is invalid. Array indices must be positive integers or logical values. getting this error command while running this code
At least the value on Obs5(1,2) is <0.5 Obs5 = [0.5 0.4]; Z=rand(2,3); old_obs_1 = plot3(Obs5(1,1), Obs5(1,2), Z(round(Obs5(1...

4 years ago | 1

| accepted

Answered
How can I mesh plot the array of a shape 1x51x51 (double)
Try the folloiwng, noticed that the axis X and Y may be inverted and you need to verify and confirm the correct direcitons. loa...

4 years ago | 1

| accepted

Answered
How to include a vector into a table and duplicate the remaing rows (see picture)
Suppose your value matrix and true/false matrix is variable "data" and "index" respectively. And the biggest table is T, with s...

4 years ago | 0

Answered
How to increase the figure size above the screen limit?
Try the following: [X,Y,Z] = sphere(16); x = [0.5*X(:); 0.75*X(:); X(:)]; y = [0.5*Y(:); 0.75*Y(:); Y(:)]; z = [0.5*Z(:); 0....

4 years ago | 0

| accepted

Answered
Saving column headers to vector
You may retrieve the header name in a cell array as follows: t.Properties.VariableNames

4 years ago | 1

| accepted

Answered
How change unit8 pixel value to intensity data
Try function <https://www.mathworks.com/help/matlab/ref/im2double.html im2double>

4 years ago | 1

Answered
I want to add data values on top of bar gragh
Check this for methods used on different Matlab version https://www.mathworks.com/matlabcentral/answers/1631625-y-data-on-the...

4 years ago | 0

| accepted

Answered
Polar Plot RLim Not Working
Determine the index for non-negative number of rho only. Beware your data are complex number. theta = linspace(-10*pi,10*pi,10...

4 years ago | 0

| accepted

Answered
How can I add a few extra things in my Graph?
You may use function text to insert text on the figure. You may define the text position better by assigning the position manua...

4 years ago | 1

| accepted

Answered
Misalignment plot with several axes
When you create a colorbar, the figure region is shifted upwards and hence it automatically adjust the positions of ax1. In ord...

4 years ago | 0

| accepted

Answered
How to read and plot multiple files
Try the following: You may now select multiple files at one time. [multifilename, pathname] = uigetfile('*.out', 'Select outpu...

4 years ago | 1

| accepted

Answered
How to separate the mixed items in the image?
Not as good as your truth image, but this may be your starting point and otehrs may comment and give you a better suggestion. r...

4 years ago | 0

| accepted

Answered
How do I generate this figure? (I can't produce bold edges)
Add the following line: t =(1:4)'*pi/2; x = sin(t); y = cos(t); h = fill(x,y,'y'); % Get the handle ...

4 years ago | 0

| accepted

Answered
readtable('filename.csv') is not importing all columns
The data in the csv file contains both strings and numbers. I would use function readcell to retrieve the data as strings and c...

4 years ago | 0

Answered
How to implement Uistyle in an output table
Actually the documentation describe a lot of examples and I just copy some of them as follows: Create a uitable on uifigure: f...

4 years ago | 1

| accepted

Answered
How to find first index before main peak in a signal ?
Suppose it is the minimum point before rising, you may try to find the first minumum point counting backwards from each peak. ...

4 years ago | 0

| accepted

Load more