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

mehr als 4 Jahre vor | 0

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

mehr als 4 Jahre vor | 0

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

mehr als 4 Jahre vor | 0

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

mehr als 4 Jahre vor | 0

| akzeptiert

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

mehr als 4 Jahre vor | 0

| akzeptiert

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

mehr als 4 Jahre vor | 0

| akzeptiert

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

mehr als 4 Jahre vor | 0

| akzeptiert

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

mehr als 4 Jahre vor | 0

| akzeptiert

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

mehr als 4 Jahre vor | 0

| akzeptiert

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

mehr als 4 Jahre vor | 0

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

mehr als 4 Jahre vor | 0

| akzeptiert

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

mehr als 4 Jahre vor | 2

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

mehr als 4 Jahre vor | 0

| akzeptiert

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

mehr als 4 Jahre vor | 0

| akzeptiert

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

mehr als 4 Jahre vor | 0

| akzeptiert

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

mehr als 4 Jahre vor | 1

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

mehr als 4 Jahre vor | 0

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

mehr als 4 Jahre vor | 0

| akzeptiert

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

mehr als 4 Jahre vor | 0

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

mehr als 4 Jahre vor | 0

| akzeptiert

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

mehr als 4 Jahre vor | 0

| akzeptiert

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

mehr als 4 Jahre vor | 0

| akzeptiert

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

mehr als 4 Jahre vor | 0

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

mehr als 4 Jahre vor | 0

| akzeptiert

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

mehr als 4 Jahre vor | 0

| akzeptiert

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

mehr als 4 Jahre vor | 1

| akzeptiert

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

mehr als 4 Jahre vor | 0

| akzeptiert

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

mehr als 4 Jahre vor | 1

| akzeptiert

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

mehr als 4 Jahre vor | 0

| akzeptiert

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

mehr als 4 Jahre vor | 1

Mehr laden