Answered
plot middle and end of an array
figure; plot(x([1:417,900:1000]), y([1:417,900:1000])) You have to put your indices into an array, then you can use them as...

9 years ago | 0

| accepted

Answered
Explanation for the code below which calculates PSNR . Does it calculates MSE?
MSE would just be md = (originalimg - restoredimg).^2; mse = sum( md ) ./ numel( originalImg ); It doesn't involve th...

9 years ago | 0

Answered
Plot a smooth graph from excel data
doc xlsread doc surf

9 years ago | 0

Answered
assigning argument to a variable
global interpmethod gridmethod defines to empty global variables of those names or, if they already exist in the global nam...

9 years ago | 0

Answered
How to use svd in cellfun?
instsvd = cellfun(@(x) svd(x), inst, 'UniformOutput', false); The first argument to cellfun should be a function handle, yo...

9 years ago | 0

| accepted

Answered
Indexing cannot yield multiple results matlab
Why on earth are you declaring a bunch of global variables of the same names as many that you are passing into your function? A...

9 years ago | 0

| accepted

Answered
How to use a timer to increase the value of a variable?
You would need to create the function as a nested function though in GUIDE this is problematic because functions are not termina...

9 years ago | 2

| accepted

Answered
How to finding the second closest number in matrix?
[~,idx] = sort( abs( A - 1999 ) ); A( idx ) will give you all of them in order.

9 years ago | 0

Solved


Vector Magnitude Calculator
'a' is a vector that starts at the origin and ends at (x, y). Find ||a||. Hint: It is as simple as "ABC".

9 years ago

Answered
Random Selection of Each Element in Vector
randA = a( randperm( numel(a) ) ) will give you them in a random order all at once. Then you can take them in turn if you ...

9 years ago | 1

| accepted

Answered
K-means Clustering
kmeans chooses seeds by a random process if you do not specify initial locations using the 'start' option. Information on how t...

9 years ago | 0

| accepted

Answered
How to made image patch?
doc patch I don't provide a transcribing service though, you can read the documentation as well as an example I waste my ti...

9 years ago | 0

| accepted

Answered
Repeated Permutation of the same numbers
e.g. for a length 3, b length 30 idxA = repmat( 1:3, [1, 10] ); % Ensure each element appears same number of times idxB ...

9 years ago | 3

| accepted

Answered
make all variables in function stored/global/accesible
Use dbstop if error to stop the code at the point in the function where the error is. I can't imagine why you would eve...

9 years ago | 2

Answered
Passing a value from a slider (guide) to a related function
You aren't calling your fitsinglebeat function anywhere, but don't pass handles to it. If you want a single value from your sli...

9 years ago | 0

Answered
How to interpolate the NaNs in the middle part of a curve
e.g. a = 1:20; b = rand(1,20); b(4:7) = NaN; newB = interp1( a( ~isnan(b) ), b( ~isnan(b) ), a ); also include...

9 years ago | 0

| accepted

Answered
How do i can return a value calculated by pushbutton by a second pushbutton ?
<https://uk.mathworks.com/help/matlab/creating_guis/share-data-among-callbacks.html>

9 years ago | 0

| accepted

Answered
Syntax error writing two classdef's
Why do you want two classdefs in one script? For a start you can't define any classes in a script, and secondly each class mu...

9 years ago | 0

Answered
Call an MLAPP with input argument(s)
This is certainly an unpleasant limitation. This is my first foray into appdesigner after being very familiar with creating pro...

9 years ago | 1

Answered
Displaying Smallest Value?
doc min

9 years ago | 0

Answered
Guide: How to save popup menu value in a text file
If you want to save the value (i.e. 1 or 2) then you need: %i or %d rather than %c. If you want the string then you nee...

9 years ago | 0

| accepted

Answered
why am i getting this error "Subscript indices must either be real positive integers or logicals."
Are you sure that is exactly the code that is giving you the error. I can't see how that exact code could possibly give that er...

9 years ago | 0

| accepted

Answered
finding indices in a string
idx = strfind( str, ' 0' ); will find you the start of each leading 0. Then you can count the zeros after each of those be...

9 years ago | 0

Answered
How to retrieve intermediate variables from a callback function?
app should be an object of a class so it has properties. You can add your own properties and then you have access to these anyw...

9 years ago | 0

| accepted

Answered
Does MATLAB use all cores by default when running a program?
User-written code will only use one core in base Matlab. I don't really know enough about how builtin functions are implemented...

9 years ago | 5

| accepted

Answered
extracting numbers from strings
If your strings are always of the form someString_someNumber then you can just use something more simple like split...

9 years ago | 0

Answered
value of variable is changed in iteration
Why would you ever choose to do this in 7 nested for loops?! You could do this far quicker just using the original a, b, c et...

9 years ago | 0

Answered
How to use loop in Anonymous functions?
I would probably just use a regular function in a file and create a handle to that. There is a limit to what you can do in an a...

9 years ago | 0

Answered
How to repair GUI Elements out of view inside panels?
View -> Object Browser from the GUIDE menu gives you access to all components, whether visible or not. You can double click ...

9 years ago | 0

Load more