Beantwortet
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);

etwa 10 Jahre vor | 0

| akzeptiert

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

etwa 10 Jahre vor | 1

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

etwa 10 Jahre vor | 1

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

etwa 10 Jahre vor | 0

| akzeptiert

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

etwa 10 Jahre vor | 0

Beantwortet
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)'}); ...

etwa 10 Jahre vor | 0

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

etwa 10 Jahre vor | 0

| akzeptiert

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

etwa 10 Jahre vor | 1

| akzeptiert

Beantwortet
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']

etwa 10 Jahre vor | 0

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

etwa 10 Jahre vor | 0

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

etwa 10 Jahre vor | 1

| akzeptiert

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

etwa 10 Jahre vor | 0

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

etwa 10 Jahre vor | 0

| akzeptiert

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

etwa 10 Jahre vor | 0

| akzeptiert

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

etwa 10 Jahre vor | 0

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

etwa 10 Jahre vor | 0

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

etwa 10 Jahre vor | 0

| akzeptiert

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

etwa 10 Jahre vor | 0

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

etwa 10 Jahre vor | 0

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

etwa 10 Jahre vor | 0

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

etwa 10 Jahre vor | 0

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

etwa 10 Jahre vor | 0

| akzeptiert

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

etwa 10 Jahre vor | 0

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

etwa 10 Jahre vor | 2

| akzeptiert

Beantwortet
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));

etwa 10 Jahre vor | 1

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

etwa 10 Jahre vor | 0

| akzeptiert

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

etwa 10 Jahre vor | 0

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

etwa 10 Jahre vor | 2

| akzeptiert

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

etwa 10 Jahre vor | 1

| akzeptiert

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

etwa 10 Jahre vor | 1

| akzeptiert

Mehr laden