Answered
I need to make a continuous timer
As far as I know, matlab timers are not restricted to a finite number of periods. If a standard matlab timer is not suitable ...

11 years ago | 0

| accepted

Answered
Hi everybody, I want different scenarios of a vector with 0 and 1 elements. For example v=[0 0 0 0 0 0 0], v=[0 1 0 1 0 1 0 ] , v=[0 1 1 1 1 1 1] and so on. But the first element of vector is fixed and has be zero .
_"Thank you very much. But I need all 64 different scenarios."_ You should have asked that to start with. Your example us...

11 years ago | 0

| accepted

Answered
How can I select the 15 best and worst score in a data set with NaN-values in it?
I'm utterly confused. You've obviously managed to write some efficient code to do exactly what you want for PAL_12. Why can't yo...

11 years ago | 0

Answered
I have data that needs to be set differently in the same for loop
You never increment your |n| within the loop. You obviously need a different variable to keep track of the peaks and valleys, I ...

11 years ago | 0

Answered
Changing values until a condition comes true
A |while| loop, as per Thorsten or the cyclist's answer is the normal way to repeat a task until a condition is met. If you're h...

11 years ago | 0

Answered
Extracting data from a vector
NewTime = time(1200:1500)

11 years ago | 0

| accepted

Answered
How to store the cell array elements into logical array?
As per Stephen's comment, a example cell from QMPR would help greatly. I strongly suspect that your |if| line is not working ...

11 years ago | 0

Answered
Scan a pattern of characters from a string
ord1 = regexp(tline, 'SSD\d+', 'match'); %if you want SSD returned as part of the match ord1 = regexp(tline, (?<=SSD)\d+', ...

11 years ago | 1

| accepted

Answered
Operations on file names
There are many ways of doing this, depending on what the criteria is for extracting the numbers (is it any number in the file? o...

11 years ago | 0

| accepted

Answered
Seperating a vector based on another vector
For a start your inner |j| loop is completely unnecessary, use logical vector indexing: C = unique(B); for idx = 1:numel...

11 years ago | 1

Answered
Double indexed recurrence relation
I may be missing something but I don't understand the difficulty. Just use two loops: maxn = 20; v = rand; p = zeros...

11 years ago | 0

| accepted

Answered
problem with gradient- index exceeds matrix dimensions.
Most likely you have a variable called |gradient|, so instead of calling the function |gradient| you're indexing into the variab...

11 years ago | 1

Answered
Passing values from an excel file to another using matlab
writetable(varfun(@abs, readtable('inputfile.xlsx')), 'outputfile.xlsx') may do what you want.

11 years ago | 1

| accepted

Answered
msgbox and then do nothing.
Replace |break| by |return|. Note that you do not need the |for| loop, use |any| and vectorised comparison instead %... ...

11 years ago | 1

| accepted

Answered
chain code for line
I've no idea what a _chain code_ is, but if you're wanting to trace the path from (s,t) to (I,J) isn't it simply finding which o...

11 years ago | 0

Answered
How to find all blocks of numbers with consecutive locations which are less than a value in an array ?
Well, finding the numbers less than 7 is trivial. Once you've done that, you've got a logical array of 0 and 1. So the problem b...

11 years ago | 2

| accepted

Answered
how to validate user input between 2 values?
_" %this 4 more times but +1 ofcourse"_. When you have to repeat the same instruction more than once, you should be thinking loo...

11 years ago | 0

| accepted

Answered
How to extract one component in a vector function
If you want to use an anonymous function as you've done for |v|, you run into the limit of matlab languages, you cannot indeed d...

11 years ago | 0

| accepted

Answered
How do I make a cell array of doubles with non-uniform dimensions into a row numeric array? (not a column numeric array)
Following on your latest comment (please don't post comments as answers): for i = 1 : (length(locs_min)*2) + 1; ou...

11 years ago | 0

Answered
Group mean for repeated samples
It looks like you can't use the date to generate (with |unique| as the cyclist suggested) a key for |accumarray|. But since your...

11 years ago | 0

| accepted

Answered
exchange cells with concerning time
As Jan says, a 100x100x4 matrix is not large at all, it's only 320 kB as double. In your case, you don't even need to have it as...

11 years ago | 0

Answered
Process input string?
I would do it like this: signal = '+ - + + - +'; [~, symbol] = ismember(strsplit(signal), {'-', '+'}); %convert '-' into...

11 years ago | 0

Answered
How to use fplot to plot a function file with single input mutiple outputs?
You'll have to explain what _'does not work for multiple outputs'_ mean exactly: fn = @(x) [sin(x), cos(x), sin(x.^2), cos(...

11 years ago | 0

Solved


For a given linear index as input for n sized square matrix, find corresponding row and column.
If input is 1, the row and column will be 1 and 1 respectively.

11 years ago

Answered
How to I pass the char value dynamically
This looks like Excel type of coordinates, so not sure what this has to do with Matlab. To get the string |'D11:H11'| with yo...

11 years ago | 0

| accepted

Solved


Can you reshape the matrix?
Given a matrix A, is it possible to reshape it into another matrix with the given number of rows?

11 years ago

Solved


Get all corner elements from a matrix where dimension of matrix is always equal to or greater than 2.
if a given matrix a = [1 2 3;4 5 6]; so answer is going to be [1 3;4 6]

11 years ago

Answered
cannot save a matlab variable
Most likely, the issue is not with matlab. There can be may reasons why a permission denied error occurs: * the file exists a...

11 years ago | 0

| accepted

Solved


unique with nan
input x = [2 NaN 3 5 NaN; 1 NaN 4 9 NaN; 8 -2 7 6 -2; 7 4 8 5 4]; output y_correct = [2 ...

11 years ago

Answered
Writing secret codes?
What you're trying to implement is a <https://en.wikipedia.org/wiki/Vigen%C3%A8re_cipher Vigenere cipher>. The way I would imple...

11 years ago | 0

Load more