Respondida
Skipping 0 value in matrix computation wich lead to NaN.
Before you take the log, get rid of the 0's: p = p(p ~= 0);

casi 10 años hace | 0

| aceptada

Respondida
What is the meaning of A{1}
A{1} is the content of the first cell in a cell array.

casi 10 años hace | 1

Respondida
Find range between two array's indexes
If you use that highest value that is still smaller than the corresponding B, you can write: C = [A(arrayfun(@(i) find(A < ...

casi 10 años hace | 1

Respondida
How do I delete a row in a matrix where the first value isn't in a corresponding matrix?
Create a logical index that has a 1 at each position where fileid has no match in id: idx = ~ismember(fileid, id); Dele...

casi 10 años hace | 0

| aceptada

Respondida
I have to plot multiple graphs on the same plot reading .sgl files ; the code i have is as follows; I am not sure how to make it read every file in turn; thanks
If filelist is a cell array of your filenames, use for i = 1:numel(filelist9 sgl=read_hsgl_riff(filelist{i}); % m...

casi 10 años hace | 0

Respondida
How do I label a plot as an object?
You can add a pause after each plot plot(time, temp) xlabel({'Time','(minutes)'}); ylabel({'Temperature','(°C)'}); ...

casi 10 años hace | 0

Respondida
Transform content of cell array to strings
cellfun is your friend here. The first argument of cellfun is an anonymous function of one argument, named c. cellfun then passe...

casi 10 años hace | 0

| aceptada

Respondida
filter parameters using if else
[a, ~, c] = unique(B(:,1)); Bnew = [a arrayfun(@(x) max(B(c==x,2)), 1:numel(a))']

casi 10 años hace | 1

| aceptada

Respondida
Calculate value based on previous row plus adjacent row
A = [0:5]; B = [0 1 3 6 10 15]; ind = 3:6; C(ind) = A(ind) + B(ind-1) M = [A' B' C']

casi 10 años hace | 0

Respondida
Changing Values in Function
It may help to define the variables outside to the local function % create the figure lowThreshold = 0; % assign dummy v...

casi 10 años hace | 0

Respondida
How do I edit the legend when I have *many* entries (but only 2 types of data)
if pltvar1srt(i) == 1.71 && 4 set(h,'FaceColor',cm(1,:)); hlegend(1) = h; else set(h,'FaceCo...

casi 10 años hace | 1

| aceptada

Respondida
Calculate the difference between two points extracted from a loop?
x(101:103) = 1; x(1090:1091) = 1; x(1200:1201) = 1; x(2201:2203) = 1; x(3200) = 1; istart = find([0 d...

casi 10 años hace | 0

Respondida
TIFF (Tagged Image File Format) Compression
This may be helpful: <https://havecamerawilltravel.com/photographer/tiff-image-compression> The criterion for compression is ...

casi 10 años hace | 0

| aceptada

Respondida
How can I use Otsuthresh correctly to convert an image to binary?
I your aim is to separate the bacteria from the background, I think you cannot do this with a simple thresholding, because the i...

casi 10 años hace | 0

| aceptada

Respondida
Correct way of plotting images
I usually use imshow(J, []) to view the full range of data. In the end, data are always quantized to be shown as 24bit R...

casi 10 años hace | 0

Respondida
How to save a figure in a different directory and with a dynamic name using export_fig?
Some hints, since it appears to be homework: help fileparts % separate path, name and extension help fullfile % to gen...

casi 10 años hace | 0

Respondida
Writing math formula into the matlab
It depends on the context, but your code is probably wrong. You have some variable H that seems to vary according to i, l and j....

casi 10 años hace | 0

| aceptada

Respondida
Trying to reduce the size of an image
You can write the image to jpg and adjust the 'Quality' between 0 and 100 to reduce the size (lossy compression): imwrite(I...

casi 10 años hace | 0

Respondida
how can I calculate number of pixel in each angle of a circle??
I = imread('../../Downloads/testimage.jpg'); % use ginput to determine the center: click where the center should be, % t...

casi 10 años hace | 0

Respondida
What is the best way to find an accurate threshold value for im2bw?
Steve's blog may help: <http://blogs.mathworks.com/steve/>

casi 10 años hace | 0

Respondida
Calculate Area under Surface
x = 1:60; y = exp(-0.1*x); % sample data plot(x,y) trapz(y) % area under the curve Note that if the curve is below...

casi 10 años hace | 0

Respondida
how to save all iteration matrices and put it into big one
You don't have to create splitQ, you can work on Q directly: ind = 1:19:size(Q,1); % create the starting indices of the rows...

casi 10 años hace | 0

| aceptada

Respondida
Moving specific files to specific folders
direc = dir; filenames = {}; [filenames{1:length(direc),1}] = deal(direc.name); first3 = cellfun(@(x) x(1:3), filename...

casi 10 años hace | 0

Respondida
I would like to draw a plot like below just exact like image below, How can I do that ?
x=[1:6]; y=[0.19 0.525 1.175 2.795 7.008 20.210]; ax_invisible=axes('color','none','Ytick',[]); ax2=axes; ...

casi 10 años hace | 2

| aceptada

Respondida
How can i plot a continuous graph with NaN in matlab?
x = sum(mat, 2); A = mat(~isnan(x), :); subplot(2,1,1), plot(A(:,1),A(:,3)); subplot(2,1,2), plot(A(:,1),A(:,4));

casi 10 años hace | 1

Respondida
How can I open a fig from a subfolder?
openfig('./yoursubfolder/your.fig')

casi 10 años hace | 0

| aceptada

Respondida
How to find floor value of a cell??? please help....
floor(cell2mat(C))

casi 10 años hace | 0

Respondida
How to "highlight" an individual bin in a histogram?
You can draw a patch on top of the bar you like to highlight: Create the histogram H = histogram(a); Highlight the it...

casi 10 años hace | 2

| aceptada

Respondida
how to load matrices from mat file
load yourmatfile.mat for i = 1:20 for j = 1:25 eval(['A1(:,:,' int2str(i) ',' int2str(j) ') = A1B' int2str(i) 'C'...

casi 10 años hace | 1

| aceptada

Respondida
Can you move figures in subplot in there given subplot location?
h = subplot(5, 2, 10); % your plot command here % adjust position; the offset has to be determined by visually by trial a...

casi 10 años hace | 1

| aceptada

Cargar más