Respondida
How can I remove red rectangles from the image or convert the red rectangle color in the image to white?
You could try to bludgeon the image with a median filter, but that's not going to be too great: A = imread('https://www.mathwor...

casi 5 años hace | 0

Respondida
Plot function behave differently when only using line versus only using markers when plotting data with NaN values
Reposted from comments: Without knowing what the data looks like, I imagine that not all values are NaN. Markers will be visib...

casi 5 años hace | 0

| aceptada

Respondida
how do I do Integration
For a constant function like that, you could just do it geometrically: f = 2; xrange = [0.1 0.5]; s = f*abs(diff(xrange)) ...

casi 5 años hace | 0

| aceptada

Respondida
Sine function along inclined z axis
Consider the 1-D example: rotangle = 45; x = linspace(0,6*pi,500); y = 2*sin(x); trl = tand(rotangle)*x; % simple metho...

casi 5 años hace | 0

Respondida
Mathwork address is required. My apologies if its not Matlab question
This shows the address registered for tax purposes. I do not know if there are other office locations. I suppose that depends ...

casi 5 años hace | 0

| aceptada

Respondida
is an ellipse-shaped structuring element possible
It's possible, just not with strel(). % build test image testsz = [35 35] A = false(testsz); A(ceil(testsz(1)/2),ceil(test...

casi 5 años hace | 0

| aceptada

Respondida
Interpolation on a 2d grid for a single point
I suppose if you just want to restrict the process to just the four neighbor points, you could do something like this. I'm sure...

casi 5 años hace | 0

Respondida
How can I arrange images of splat over a 2D grid/matrix to form a 2D microstructure image?
Here's a start. I imagine you may want to do other things (e.g. controlling spot size or randomizing it?). I'll leave those ch...

casi 5 años hace | 0

Respondida
How to change a 3x3 median filter to 5x5?
Start by simplifying: % 2. Median Filter %READ IMAGE inpict = imread('sadimg.bmp'); %imshow(inpict) %title('IMAGE WITH NOIS...

casi 5 años hace | 0

Respondida
Four different outputs keep ending up with the same "answer" when I don't believe they're supposed to.
Something like this: numsteps = 100; numtrials = 10; distances = zeros(numtrials,1); finalpos = zeros(numtrials,2); for j...

casi 5 años hace | 0

| aceptada

Respondida
Can't work out what I did wrong
There were some parentheses misplaced in the expression for f. That said, the error is still large, but I suppose that's intent...

casi 5 años hace | 0

| aceptada

Respondida
Need help to seperate the text from the background
Thresholding might be part of it, but it'll take a lot of other work to make the masks into something useful. A = imread('https...

casi 5 años hace | 1

| aceptada

Respondida
How do I calculate a logarithm of a variable base?
Nowhere in the synopsis for log() does it say that it accepts two arguments. For base 2, you can just use log2() More generall...

casi 5 años hace | 0

Respondida
How does imflatfield work?
William's comment is close. Probably close enough to be useful, but not quite exactly the same as what imflatfield() does. A =...

casi 5 años hace | 0

Respondida
How can I save a variable from the workspace to use it for another script?
You can save variables to a .mat file and then load the .mat file in the other script. https://www.mathworks.com/help/matlabmob...

casi 5 años hace | 0

| aceptada

Respondida
How do I create a matrix with specific values?
Something like this: expbasket = randi([-9 9],6,21); % placeholder data rvalue = [-9; -6; -3; 3; 6; 9]; % don't need the whole...

casi 5 años hace | 1

| aceptada

Respondida
how to copy arrays in a cell?
Just use repmat vel1 = repmat(vel1,[8 1]);

casi 5 años hace | 2

| aceptada

Respondida
Cannot open file "Dataset\" for reading. You might not have read permission.
Something like this dirname = 'sources'; % or whatever directory you choose % get directory contents allfilenames = dir(dir...

casi 5 años hace | 0

Respondida
How to use randperm command with same starting and ending number each time to generate random numbers?
Here's one way. It can probably be simpler than this, but eh. N = 7; startnum = 3; endnum = 6; R = 1:N; R = R((R~=start...

casi 5 años hace | 0

| aceptada

Respondida
How can I make true false codition?
My understanding is that you're manipulating the mirror array in the DMD and then taking an image. It's not clear why you're re...

casi 5 años hace | 0

| aceptada

Respondida
Subtracting two regions of interests
I don't know that the ROI objects themselves can be combined. It may be possible to get the vertex list and do some external wo...

casi 5 años hace | 0

| aceptada

Respondida
Result according to corresponding variables
We're going down a bad road if we're trying to use variable names as variables. If instead of using numbered variables, A1,A2,A3...

casi 5 años hace | 0

| aceptada

Respondida
Integration and average of the pixel values for an image.
You just mean the global sum and mean? Should the image be normalized? Assuming not: A = imread('cameraman.tif'); % this is u...

casi 5 años hace | 0

| aceptada

Respondida
how to generate and cover all the possible arrays using two enties
If you mean actual strings instead of chars, then: A = dec2bin(0:15); A(A=='1') = 'H'; A(A=='0') = 'C'; A = string(num2cell(...

casi 5 años hace | 0

| aceptada

Respondida
How can I create a nested loop without confusing the indeces?
Let's see if I understand the intent... I don't know what z and u are, so I'm just going to use placeholders. N = 10; alpha = ...

casi 5 años hace | 0

Respondida
Determine Camber and Thickness of a Airfoil - Given the xy coordinates
This isn't exactly a great way, but I'm more used to abusing image processing tools than polyshape() and such. The mention of V...

casi 5 años hace | 0

Respondida
Custom color of a line based on the value of the 3rd parameter
There are a couple ways to do this. Using surf() seems to be the better way in general for lines. x = [1,2,3,4,5,6,7,8,9,10]; ...

casi 5 años hace | 0

| aceptada

Respondida
How to write a regular expression to extract a vector ([6.300000000000001,0.1,-7.5]) using regexp?
Akira's comment may be very relevant, but since I'm unfamiliar with handling JSON, I'll just throw down a regex kludge as reques...

casi 5 años hace | 0

Respondida
I need help on how to make the code for this problem...
If you ask me, this is just another poorly worded assignment. If x is a 100 element linear ramp from 0 to 10, then how is it im...

casi 5 años hace | 0

| aceptada

Respondida
Efficiency and alternatives for for loops
I'm not sure if this is going to give you exactly what you want. The following simplified example will produce the same boundar...

casi 5 años hace | 1

| aceptada

Cargar más