Réponse apportée
How can I find the first integer n for which the sum of the numbers below is greater than 2.5?
Here's one simple way: kmax = 10; n = 1:kmax; s = cumsum(1./n); [n' s'] kest = n(find(s>2.5,1,'first'))

plus de 4 ans il y a | 0

Réponse apportée
sum of complicated numbers
Consider the reduced example. N = 21; n = 1:2:N n = (1-2*mod((n-1)/2,2)).*n s = sum(n) If you must absolutely do it with ...

plus de 4 ans il y a | 0

Réponse apportée
How to convert 3D to 4D images
If you have a volumetric image represented in a 3D array and you want to slice it on dim 3 and arrange each slice into a frame i...

plus de 4 ans il y a | 0

Réponse apportée
Why do I find different SSIM values depending on whether the images' intensity information is stored in the range [0 1] or [0 255]?
You're passing images to ssim() which are improperly-scaled for their class. Many functions make assumptions about the expected...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
Can we assign or associate the random points only that located inside the a specific range ?
Here's a start. I used different colors for clarity, but you can change that to whatever you want. ro=1000; % radius of the l...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
No Plotting Done In Function With Changing Variables
The problem is how you're specifying the linetype and when you're doing the plotting. Since you're plotting each point one at a...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
How to find the partial sum of the series using while loop?
Using a while loop when the number of iterations is known is an unnecessary invitation for mistakes like that. You weren't incr...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
How do I apply distance formula for 3D coordinate points for all elements in a cell array?
How about something like this? S = load('participants_head_lefthand_righthand_positions.mat'); head_lh_rh_pos = S.participant_...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
Linear equation of circle
You mean like this? r = 1; y = linspace(-r,r,50); xr = sqrt(r^2 - y.^2); xl = -sqrt(r^2 - y.^2); plot([xr; xl],[y; y]) A...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
I am trying to write a program for a grayscale image blurring without using gaussian or conv2 function.
This should create a gaussian kernel. Padding the array is a simple and inexpensive way to deal with indexing at the image boun...

plus de 4 ans il y a | 0

Réponse apportée
sum in matlab coding
The first case is summing a linear increasing series between two values stored in a vector. The second is the sum of a subvecto...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
non zero elements in an array
I'm going to assume you're only dealing in integers here, otherwise the question arises whether values between 1 and 2 should re...

plus de 4 ans il y a | 2

Réponse apportée
addition loops in matlab
This works easily enough. After R2016a, you can do the same with movsum(). a = [1 1 1 0 0 1 1 1]; if any(conv(a,[1 1 1],'va...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
i am getting not enough input arguments error for the below code
[t,x] = ode15s(@m,[0 50],[0 0.11 0.11 0]); plot(x(:,2),x(:,3)) function dx = m(t,x) dx=zeros(4,1); dx(1) = -(1/(8200...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
want to generate this matrix
What's wrong with A = [1 1 0 0 0 1 0; 1 0 0 0 0 1 0; 1 1 1 0 0 1 0; 0 0 0 1 1 0 1; 0 0 0 0 0 1 0]; If...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
if-else statement for 4 comparison
You can do it something like this, assuming your inputs are binarized as described. A = [0;1;0;1;1;0;1]; B = [0;1;1;0;1;1;0]; ...

plus de 4 ans il y a | 1

Réponse apportée
How to store output mean, S.D and what column number in a matrix
Something like: A = rand(10); colmean = mean(A,1); colstd = std(A,0,1); nspec = repmat('%6.4f ',[1 size(A,1)]); fprintf...

plus de 4 ans il y a | 0

Réponse apportée
how to code equation this equation?
Assuming T is a function: n = @(z) n(z0)*(T(z0)/T(z))^(1+g).*exp(-u*c(z))

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
Create (plot) sRGB gamut, using the boundary function?
This uses MIMT tools to do the job. MIMT maxchroma() works in LCHab (or other polar models) to find the envelope of maximum c...

plus de 4 ans il y a | 0

Réponse apportée
sum logical 1's independently for each column
If the inputs are integer-valued, just use all() A = randi([0 1],5) isfull = all(A,1) % if you really need text output for so...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
How to plot unsolvable equation
You can use fimplicit() https://www.mathworks.com/help/matlab/ref/fimplicit.html syms x y eq1 = y * sin( y ) == x * sin( x );...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
How to remove gradient line between start and end color of the colormap in filled contour plot?
That's what happens when you run contour() on data with step discontinuities. If the step goes from Zmax to Zmin, then it will ...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
Alternative for linspace?
Why not just use the colon operator? r = [-4 4]; n = 10; x1 = linspace(r(1),r(2),n) x2 = r(1):range(r)/(n-1):r(2) This ...

plus de 4 ans il y a | 0

Réponse apportée
how to open the image extension .dat
Knowing the image geometry is 90% of the battle. Imrectify() can do a good job of figuring it out, but I never wrote it to hand...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
Colour Associated with a Point in a Colourmap
Here. This may be close to what you're trying to do. I don't know that it's really any clearer to do this than it is to put th...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
How to extract color parameters of each rice grain and then how should I compare them?
Consider what information is available. The exposure doesn't seem too bad. There are some grains which seem maybe a bit more c...

plus de 4 ans il y a | 1

| A accepté

Réponse apportée
Add number to every value in the vectors within a cell array (without loop)
You can use cellfun() to apply an operation to the contents of a cell array. Elementwise arithmetic operations between a scalar...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
How can I uniformly disperse circles in an array?
This does not require any Computer Vision Toolbox functions and outputs a raster image. d = 7; % dot diameter s = [800 1000]; ...

plus de 4 ans il y a | 1

| A accepté

Réponse apportée
defining the center of an image and recognise the contrast disks
Consider the example: A = imread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/890405/image.png'); B = bware...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
Clabel line break for label
As far as I know, no. There isn't a proper way to do that in manual mode. See the answer here: https://www.mathworks.com/matl...

plus de 4 ans il y a | 1

Charger plus