Answered
Finding TP, TN, FP, FN using histc. First Input must be a real non-sparse numeric array (error)
The negation (~) is turnning the array into a logical array. As the error message indicates, the first input is expected to be ...

7 years ago | 1

| accepted

Answered
Data Cursors on Line Plot With Spectrogram Subplot
Source of the problem The following sequence of functions are called when producing the spectrogram() plot. spectrogram() > ps...

7 years ago | 0

| accepted

Answered
How can I draw std ellipses in a scatter plot?
Here's a function that will plot std ellipses where the vertical distance to the center is 1 std of y and the horizontal distanc...

7 years ago | 2

| accepted

Answered
How to change the name of an image?
You can use movefile() to create a copy of the file with a new name. Then you can use delete() to delete the old copies forever...

7 years ago | 0

| accepted

Answered
How to insert grid lines specific position ?
Here's a demo % Define bound %bound(1) is the x value of the bottom, left corner of the frame %bound(2) is the y value for th...

7 years ago | 0

| accepted

Answered
Avoid turning plot when on a figure
"I tried set(gca,'Ydir','reverse'), but it did not work." That's because for image() plots the ydir is already set to 'reverse...

7 years ago | 0

| accepted

Answered
normxcorr2 - technical reference document
Technical reference; scroll down to the "algorithms" section (see comments below). https://www.mathworks.com/help/images/ref/no...

7 years ago | 1

Answered
Easiest way to change variables based on decisions made by user?
If you're not already working from a GUI and the only interface is this one question, here's a quick and easy solution. respon...

7 years ago | 1

| accepted

Answered
indexing problem in cell array
Tested on r2014a (after brushing the dust off of it). % Create cell array as is described in the quesiton Zellprojekte = stru...

7 years ago | 0

| accepted

Answered
How to add a legend in the Mapping Toolbox?
Use the DisplayName property (you can change the labels from my example) Use the output handles produced in scatterm() Provide...

7 years ago | 0

| accepted

Answered
How to solve this equation with two variables in one equation ?
Loop through index values rather than a vector of values. Store each iteration in w(n,c) and pre-allocate w with NaNs. A = ...

7 years ago | 0

| accepted

Answered
Find Number of Elements in an Array
The "A" array provided in the question will result in a dimensions mismatch error. I'm assuming A is an [nx2] char array. A ...

7 years ago | 0

Answered
Deleting circles drawn using viscircles
The handles are being overwritten on each iteration of the i-loop so at the end of the loop, you only have access to the last dr...

7 years ago | 1

| accepted

Answered
How can I compare two columns at the bar chart?
Here's a demo to get you started. clf() h = bar([210, 140, 175, 160]); set(gca,'xtick',1:4,'xticklabel',{'A','B','C','D'}) ...

7 years ago | 1

| accepted

Answered
Concatenate two audio files
If your intentions are to subsample every 8000 values in y1 and then concatenate y2 to the end, y3 = [y1(1:y1_sample_rate:nume...

7 years ago | 0

| accepted

Answered
How to get the point under mouse click on the plot or histogram?
You can use the ButtonDownFcn function. Here's a demo you can run. It prints the selected bar index to the command window. fig...

7 years ago | 0

| accepted

Answered
inputparser fails to accept correct value
isinteger(1) % = FALSE This matlab function (which often causes confusion) does not determine if the input has an integer val...

7 years ago | 0

| accepted

Answered
Testing if a input is a numerical (double) of character
You can use str2double() to convert the string to numeric. If the string did not contain something that can be converted to num...

7 years ago | 0

| accepted

Answered
Auto close uifigure upon deletion of handle from workspace
"This would prevent opening many instances of the class when running some script multiple times, while the handle to the GUI is ...

7 years ago | 0

Answered
ERROR came as "Index exceeds matrix dimensions".
f1 = 0; % 12th line of your code; so, f1 only has 1 element % (later in your code...) for j=2:J % interior nodes ...

7 years ago | 0

Answered
how can i generate random number divided by 0.25 from 0 to 10 for example(0.25,7.75,5.50,6.25 ,........)?
% Generate 12 random number between [0,10] rn = rand(1,12)*10; % Round to nearest .25 rnRounded = floor(rn) + round(rem(rn,1...

7 years ago | 1

Answered
How could I set the legend for a particular bar in a bar chart?
Assign a name to the "DisplayName" propery of each grouped bar handle. The display name will be used in the legend. Here's an e...

7 years ago | 7

Answered
How can i show plot inside ui app instead of another figure window?
Specify the UI Axis handle in the first input to plot(). plot(app.UIAxes, imageData); % __________ or whate...

7 years ago | 1

| accepted

Answered
how to construct a cell array from another cell array
This fits the description from your comment under your question. It horizontally concatenates all combinations of the row vecto...

7 years ago | 0

| accepted

Answered
How to Break 'switch' statement without exiting entire 'while' loop.
Unlike other programming languages, "When a case expression is true, MATLAB executes the corresponding statements and exits the ...

7 years ago | 0

Answered
Interpolating linearly between many values in a vector
Set the 'resampleRate' to 1000 if you want [1,2] to become [1.001, 1.002, ... 2.999]. 'timestamps' is your original vector. r...

7 years ago | 0

Answered
Best Way to find density of [x,y] coordinates within set window
Here's an alternative that uses inpolygon() to determine whether coordinates are within a defined rectangular window centered at...

7 years ago | 2

| accepted

Answered
How to compare words in a line
Attached are 2 text files. "txt.txt" contains the text you shared in your comment under your question. "dcm.txt" is a vertical l...

7 years ago | 1

| accepted

Answered
How to open .m fiile in editor and move to specific line number?
openAndGoToLine() Input 1 is a string identifying the absolute path to the file. Input 2 is an integer indicating the line num...

7 years ago | 6

| accepted

Answered
How to match points in two unequal list?
Here's how to find the closest value in B for each value in A. A = [1.1 2.2 3.1515 4.92121 1.1]; % Row vector! B = [1.25 ...

7 years ago | 0

| accepted

Load more