Respondida
How do I change a 512*512 image code to any size code?
This should be a start % this presumes the image is uint8, so be careful % if you have IPT, you can use im2double() instead A...

más de 5 años hace | 0

| aceptada

Respondida
nested if-else inside nested if-else
I don't have the same problem when I run it. There was some other issue though. img = rgb2gray(imread('sources/table.jpg')); ...

más de 5 años hace | 0

| aceptada

Respondida
Make contour labels smaller?
It can be done, but it's a little awkward: % this is just some test data lat = 27.988056+(1:50); lon = 86.925278+(1:50); [la...

más de 5 años hace | 1

Respondida
Subtact one column of a cell array from another and put the result in the 3rd column
I'm going to assume those are all datetime values % make test array t1 = datetime('now','Format','HH:mm:ss'); t = t1 + minute...

más de 5 años hace | 0

Pregunta


In what version did certain colorbar properties change?
This is an exercise in a routine frustration; forgive me for letting it show. Someone has code which manipulates colorbar objec...

más de 5 años hace | 1 respuesta | 0

1

respuesta

Respondida
Grouping age data into 5 year bins
I'm going to just do this example starting with a numeric vector, but you can adapt it to use your table if you want. age = ran...

más de 5 años hace | 0

| aceptada

Respondida
Sum alternaing columns of a matrix
Something like A = randi(9,3,10) a0 = sum(A,1) % show all column sums as an example a1 = sum(A(:,1:2:end),1) % odd col sums...

más de 5 años hace | 1

| aceptada

Respondida
setting color scale of two datasets in the same axis in Matlab
It's certainly possible. It's not any fun, if you ask me. You can do it with overlaid axes. This post contains one example: ...

más de 5 años hace | 1

| aceptada

Respondida
Adding images to reach a final composite.
By averaging, you're essentially extracting the BG, but not really in a way that would produce a BG estimate that's good for BG ...

más de 5 años hace | 1

| aceptada

Respondida
How to extract 6 neasrest neigbors for particles
This can probably be improved, but this was what I did: A = [1 19 0.874004; 1 41 1.130905; 1 42 1.131306; 1 45 0.841402; ...

más de 5 años hace | 0

| aceptada

Respondida
4d Array converting RGB image into binary
imshow(XTrain(:,:,2)) Is going to be a 4D monochrome image, which imshow won't like. I'm assuming you meant imshow(XTrain(:,:...

más de 5 años hace | 0

| aceptada

Respondida
Plot the part of the cylinder x^2 + z^2 = 1 for y ≥ 0 , 0 ≤ z ≤ − y^2 + 1 . Can someone help me
This is a rather simple approach: n = 200; th = linspace(0,pi,n); x = linspace(-1,1,n); y = linspace(0,1,n).'; zc = rep...

más de 5 años hace | 0

Respondida
how to find the distance of all objects in given image
This will give an array mapping the distance from every object to every other object. You could reduce this with triu() if you ...

más de 5 años hace | 0

| aceptada

Respondida
How to detecct specific circle and set values inside to 0
There are probably other ways to do this, but this is what I rolled: inpict = rgb2gray(imread('us2.bmp')); % generate a mask...

más de 5 años hace | 0

| aceptada

Respondida
Filling array with dec2hex() value
Observe that the output of dec2hex() is a character array: x = 123 hx = dec2hex(x) gives x = 123 hx = '7B' So in ...

más de 5 años hace | 1

| aceptada

Respondida
matlab words no help needed
What you're looking at isn't meaningful. It's all just rounding error. You're essentially doing this: y = sin(x) - sin(x); I...

más de 5 años hace | 0

Respondida
Decimal numbers problem on plotting
Consider: % make a simple plot that reproduces the fractional year ticks x = 2016:0.5:2020 plot(x,x) % get rid of tick lab...

más de 5 años hace | 0

Respondida
How to change the colors of the plotted lines in for loop?
You're flirting with disaster by doing this: col=['r' 'b']; % this is literally 'rb' As KSSV mentions, your first indexing ope...

más de 5 años hace | 0

Respondida
How to give a common title for the figure with subplots
You may want to try suplabel(). Suplabel() can provide overarching axis labels or titles for a group of subplots. https://www....

más de 5 años hace | 0

| aceptada

Respondida
smoothing a curve efficiently
Since you haven't said what you actually attempted and haven't given any sample data or even revealed the domain and range of th...

más de 5 años hace | 0

| aceptada

Respondida
How to get shades and tints of a color hex with Matlab?
There are a number of ways you could do it. The simple way would be to just interpolate between that color tuple and white (or ...

más de 5 años hace | 1

| aceptada

Respondida
How to get the last two digits of a number?
Assuming they're integers: % 10 rows random integers n = (randi(8999,1,10)+1000)' n = [n mod(n,100)] If they aren't intege...

más de 5 años hace | 1

Respondida
add variable in the graph legend
I'm not sure what you're asking for, so I'll try a couple possibilities. If you want to put variable names in the legend text, ...

más de 5 años hace | 0

| aceptada

Respondida
how to interpolate between two point of 1d time series data if the difference between any two consecutive point is greater than 25?
Maybe something like this: x = [5 10 36 20 17 5 51 60 40 13]; L = numel(x); fs = 4; t=0:1/fs:(L-1)/fs; idx = find(abs(dif...

más de 5 años hace | 1

| aceptada

Respondida
Using CLI programs in Matlab
If this were *nix, you may be able to write an expect script to handle getting into and out of the other CLI program. man expe...

más de 5 años hace | 0

Respondida
numarical question interpolating polynomial code
% don't waste the user's time and invite error by making them % retype every single number every time the script runs x = 1.4:...

más de 5 años hace | 0

Respondida
tofloat and Paddedsize functions
tofloat() and paddedsize() are not Matlab functions in any toolbox I know of. If you found these in some code that you found so...

más de 5 años hace | 1

Respondida
program to reshape an array and perform some operations.
Your example is not working and leaves ambiguity. B-F are 1x16 vectors, and you're trying to reshape them to be 2x2. Besides n...

más de 5 años hace | 0

| aceptada

Respondida
CLAHE wothout adapthisteq .
I know this is ancient, but I'm browsing and I put answers where the next person can find them. The ClipLimit parameter adjus...

más de 5 años hace | 0

Respondida
Is MathWorks working on a dark mode for MATLAB similar to what Visual Studio offers?
I've been using a workaround for years, and it is version-agnostic. The script is posted here, though you'll need to modify it ...

más de 5 años hace | 3

Cargar más