Answered
Generate same array as what imwrite produces from a double array
I can answer that question, but I don't know that you mean to be doing the thing you're trying to do. Most IPT tools assume t...

5 years ago | 0

| accepted

Answered
Different Function Input Formats
For the case where looking for a specific string: varargin = {'aaa','bbb',13,{'a','b'},[12 34],'ccc'} % let's pretend we have s...

5 years ago | 1

| accepted

Answered
Create binary matrix with some conditions (Matlab)
Well, I'm not exactly the guy to ask for elegant solutions to anything, but I'll take a stab at it. clc H=[1 1 1 1 1 1 0 0 0 0...

5 years ago | 0

| accepted

Answered
Color objects with areas larger than a set value
I'm not familiar with the video IO tools, but isolating/coloring the large objects should be easy enough I = imread('dots.jpg')...

5 years ago | 0

| accepted

Answered
Please Help.. How can I display a certain value in my plot?
A simple way would be to use the legend itself, something like this: x=linspace(0,2*pi,100); y=sin(x); xmark=pi/4; clf pl...

5 years ago | 0

| accepted

Answered
Obtain cross section from a plot
The answer is going to vary depending on how complicated you actually need to make it. If all you really need is going to be an...

5 years ago | 0

Answered
How to find the first element in ascending numbers that repeat?
You said you want the first instance where the next number is larger, but the desired output you gave [1 12 22] is all instances...

5 years ago | 0

| accepted

Answered
how get value from edit textbox gui matlab
If you know what editbox you're looking for in your handles object, you can just get its contents myvariable=get(handles.myedit...

5 years ago | 0

Answered
Variable 'k' is not fully defined on some execution paths.
If neither nl(I) nor nr(I) equal n, then k is undefined. if (nl(I) == n) k = nr(I); elseif (nr(I) == n) k = nl(I); ...

5 years ago | 0

| accepted

Answered
How can I plot a function?
Try this: x=1:5:800; y=@(x) 4*pi*28*10^9 * x/(3*10^8); %i'm assuming you want pi there plot(x,y(x)) % use it as a function

5 years ago | 0

Answered
How to save image pixel size larger than large than 343x343
As I mentioned, doing it this way is a bit fiddly. It relies on the figure window being big enough. I've already noticed that ...

5 years ago | 0

| accepted

Answered
How to make a grid periodic
Do you actually need plot lines, or are you trying to make the plot gridlines have a particular spacing? If the latter, conside...

5 years ago | 0

Answered
Solve a numerical equation using for loop
This might help: psize=[10 10]; A=rand(psize); B=rand(psize); C=rand(psize); xAve=2; t=0.1; S = struct('x',[],'y',[]); ...

5 years ago | 1

| accepted

Answered
3D surface plot of integrated function
You can use cylinder. You just need to orient it as needed. For orthogonal rotations, that's easy enough. r = [1:1:350]; S ...

5 years ago | 1

| accepted

Answered
Modified Thompson - User Defined Function Errors - "function 'modifiedthompson' has already been declared within this scope", "the function return value might be unset", and "the function 'modifiedthompson' might be unused".
I'm not sure about what you're showing here. I see three blocks of code. As I understand it, the first is your script with a l...

5 years ago | 0

Answered
convert image matrix to row vector
Consider a 3x3 test image: A=repmat(1:3,[3 1]) A = 1 2 3 1 2 3 1 2 3 The line I s...

5 years ago | 0

Answered
Read images from a folder in a particular order
This is pretty much what natsortfiles is for https://www.mathworks.com/matlabcentral/fileexchange/47434-natural-order-filename-...

5 years ago | 0

| accepted

Answered
Same colour for two curves in a plot
Something like this. You'd just have to pick the colors you want. h=plot(x,y); set(h, {'color'}, {[1 0 0]; [1 0 1]; [1 0 0]})...

5 years ago | 0

| accepted

Answered
Putting an element from one matrix to another, if it has a certain variable
You can use has() to test for the presence of a variable (or any other subexpression). syms a b c expr1=a+b==1; if has(expr...

5 years ago | 0

Answered
How to save image as pixel by pixel size and without white background
Getting figures saved in a particular way is always a challenge, and the methods vary with versions. Personally, I just use exp...

5 years ago | 0

| accepted

Answered
Error plotting fzero function - "Operands to the || and && operators must be convertible to logical scalar values"
You've set Distance_from_throat to a vector. As far as I know, fzero() handles scalars only. You can always find all the solut...

5 years ago | 0

| accepted

Answered
Error using plot comand
img = imread('1.jpg'); img is a MxNx3 image. If you expect it to be MxNx1, flatten it in an appropriate manner. Y = abs(fft(...

5 years ago | 1

| accepted

Answered
I can not convert segmented image into binary properly and also can not show the binary result. Please help me.
Considering I don't know what your images are (and I don't have CVT anyway), I can't say much. Obviously, the error is saying t...

5 years ago | 0

| accepted

Answered
How to open and work with dicom images, which has no .dcm file extension.
I don't really know what this has to do with filename extensions, though I would imagine that the right way to handle that would...

5 years ago | 0

| accepted

Answered
Flipping a curve to match another in a figure
I'm not really sure what you're expecting, but you can flip it easy enough. plot(XX,YY,'b'); hold on; xmax=max(XXXX); yma...

5 years ago | 0

| accepted

Answered
How can i perform manual convolution in an image MxNx3
I'm not sure why you expect the convolution of a MxNx3 image with an IxJx1 filter to be a MxNx1 image. It would be a MxNx3 imag...

5 years ago | 0

| accepted

Answered
Rotating a Cylinder to fit the line x=y=z
The vector you're using is the vector you're trying to align the cylinder to. The vector you need to be specifying is the axis ...

5 years ago | 1

| accepted

Answered
How to generate a square wave with integer values and fixed timespan?
Something like this. I'm assuming you want your timestep to be a uniform 30ms. clf % build the coarse signal dt=0.03; y=[...

5 years ago | 0

| accepted

Answered
How do I pad the middle of an array?
For vectors, you can just extrapolate each segment and cat them back together. You'd need to determine where each step is. a=[...

5 years ago | 0

| accepted

Answered
Drawing multi segments in polar coordinates
Try something like this clf r=[0.5 1]; % minor, major radii h0=0; % base height h=0.25; % height th0=0; % start angle (d...

5 years ago | 0

| accepted

Load more