Réponse apportée
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);

plus de 9 ans il y a | 0

| A accepté

Réponse apportée
What is the meaning of A{1}
A{1} is the content of the first cell in a cell array.

plus de 9 ans il y a | 1

Réponse apportée
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 < ...

plus de 9 ans il y a | 1

Réponse apportée
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...

plus de 9 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 9 ans il y a | 0

Réponse apportée
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)'}); ...

plus de 9 ans il y a | 0

Réponse apportée
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...

plus de 9 ans il y a | 0

| A accepté

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

plus de 9 ans il y a | 1

| A accepté

Réponse apportée
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']

plus de 9 ans il y a | 0

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

plus de 9 ans il y a | 0

Réponse apportée
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...

plus de 9 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 9 ans il y a | 0

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

plus de 9 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 9 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 9 ans il y a | 0

Réponse apportée
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...

plus de 9 ans il y a | 0

Réponse apportée
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....

plus de 9 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 9 ans il y a | 0

Réponse apportée
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...

plus de 9 ans il y a | 0

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

plus de 9 ans il y a | 0

Réponse apportée
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...

plus de 9 ans il y a | 0

Réponse apportée
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...

plus de 9 ans il y a | 0

| A accepté

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

plus de 9 ans il y a | 0

Réponse apportée
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; ...

plus de 9 ans il y a | 2

| A accepté

Réponse apportée
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));

plus de 9 ans il y a | 1

Réponse apportée
How can I open a fig from a subfolder?
openfig('./yoursubfolder/your.fig')

plus de 9 ans il y a | 0

| A accepté

Réponse apportée
How to find floor value of a cell??? please help....
floor(cell2mat(C))

plus de 9 ans il y a | 0

Réponse apportée
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...

plus de 9 ans il y a | 2

| A accepté

Réponse apportée
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'...

plus de 9 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 9 ans il y a | 1

| A accepté

Charger plus