Answered
How can I turn a matrix into character text in MATLAB?
One way: lettervalues = randi(27, 1, 50) actualletters = char(lettervalues + 'A' - 1); actualletters(lettervalues == ...

9 years ago | 0

Answered
findpeaks in for loop; find maximum's corresponding x value
|findpeaks| returns all the peaks it finds by default. if you just want the largest one you can change your call to: [~, lo...

9 years ago | 0

| accepted

Solved


Pair Primes
Let's define pair primes as follow; * *For 2 digits numbers:* 11 and 17 are pair primes because both of them are 2 digits pri...

9 years ago

Answered
selection of data from matrix
There are many ways you could do this. You could keep track of the row you've selected and exclude them from the set of rows to ...

9 years ago | 0

Answered
How can this Python code be written in Matlab? I'm trying to write a Matlab script that will allow two Stepper motors to scan in a Raster pattern but all I can find is this Python script. How the 'for' loop be replicated in Matlab?
_What I'm trying to do in this code is start at some point within the grid say (0,0) then move a fixed amount of steps in the x ...

9 years ago | 0

Answered
How to append structures?
For your dates, I would recommend that you store them as <https://www.mathworks.com/help/matlab/ref/datetime.html |datetime|> ra...

9 years ago | 1

Answered
Only plotting on the last of three axes?
_Each axes has its own plot function_. What does that mean? If a figure has several axes, that means you used <https://www.ma...

9 years ago | 1

| accepted

Answered
how to draw a set of triangles without adding lines between 2 triangles in matlab?I have tried many codes but they did not work.
The simplest way is to use <https://www.mathworks.com/help/matlab/ref/patch.html |patch|>. Let's use a bit less triangles to see...

9 years ago | 0

| accepted

Answered
How can I search for a string in a cell array of varying lengths?
You're using the newish matlab string, which are a lot easier to use than the older char array. In particular, you don't need a ...

9 years ago | 1

Answered
Vertically concatenate blocks of arrays
The problem I have when reading your code, other than the lack of comment, is that I come across load(fileDir) At this p...

9 years ago | 1

| accepted

Answered
Operands to the || and && operators must be convertible to logical scalar values. when using an array
|||| and |&&| are <https://www.mathworks.com/help/matlab/ref/logicaloperatorsshortcircuit.html short circuit operators> that ind...

9 years ago | 1

Answered
Max Sharpe ratio errors
Remove the |...| on the first line. It looks like that line was originally on two lines and you made it just one line without...

9 years ago | 0

Answered
How do I use the tag/name/handle of a axes rather than gca
You can use <https://uk.mathworks.com/help/matlab/ref/findobj.html |findobj|> to find axes with a given tag (as far as I know, t...

9 years ago | 0

| accepted

Answered
indexing must appear last in an index expression error
Note: when saying there is an error always give the *complete* error message, everything in red. Error message usually shows you...

9 years ago | 1

Answered
Where can I found (.dbc) file for Peak Systems CAN FD ?
You don't _find_ a dbc file. A dbc file describes what the messages sent by your CAN network actually mean. If you're the creato...

9 years ago | 1

Answered
Gaussian distribution with randn
By definition, a gaussian distribution covers the whole range [-&infin;, +&infin;]. If your distribution has a min and max it's ...

9 years ago | 1

Answered
No result for while loop Statement
Well, if you hadn't put a semicolon at the end of the line |sum(...);| effectively making it useless by suppressing the output, ...

9 years ago | 0

Answered
Subscripted assignment dimension mismatch
In R2014 (a or b, can't remember) mathworks completely rewrote the graphics engine of matlab. With that rewrite came a lot of ch...

9 years ago | 0

Answered
Display Matrix without the assigned values of the variables
If you want symbolic names for numeric values you need to use the symbolic toolbox. In base matlab, this is not possible. Gen...

9 years ago | 0

Answered
Problem array initialization when storing Data
_I want to delet the first 200 entrys. *I'm using a for loop for that.*_ Always a bad idea. Most beginners never implement th...

9 years ago | 0

Answered
how to creat a nested for loops to print the following pattern.
We're not going to do your homework for you. That would be cheating. Here is how to do it *without any loop*, in just two lin...

9 years ago | 0

Answered
How do i check each value of one list, then use a parallel value in a different list with the same index?
goodorindeterminable = aodfilter1(ismember(qcaodfilter, [0 1]))

9 years ago | 0

Answered
Cellfun with too many outpus
_I don't know why it's giving me all other columns_ Because your |dynamika_skryte_vrstvy| function returns a row vector for t...

9 years ago | 1

Answered
Efficient way to get MSB position of a double variable
My guess is you're trying to get the index of the most significant bit of an *integer*, not a floating point double (where a num...

9 years ago | 1

| accepted

Answered
How do we compute regionprops for frames of a video, in a loop, in MATLAB?
r = VideoReader('file.avi'); centroids = zeros(r.numberOfFrames, 2); for f = 1:r.NumberOfFrames; %... ...

9 years ago | 0

| accepted

Answered
I really want to draw the precession of mercury
As the error message says x(t) is only valid if |t| is a real positive *integer*. The simplest way to solve your pro...

9 years ago | 1

| accepted

Answered
Strange behavior of if statement
|if| works fine. The problem is your expectation that |T1| as stored in the computer should ever be *exactly* equal to one. C...

9 years ago | 2

| accepted

Answered
what is the max value you can give to precision ?
This talk of precision being 1e308 or 1e10 or whatever is utter nonsense. _edit: There was another answer, now deleted, that ...

9 years ago | 3

| accepted

Answered
Difference between columns, fixed the first column, in a matrix only if values are diferent from 0
You've already figured out most of it: A = cat(3, [10 3 15 12 3; 2 1 4 0 6; -5 0 5 4 12; 7 9 4 0 8], [-3 4 10 3 0; -3 1 0 4...

9 years ago | 1

| accepted

Answered
How to access UNC path with credentials?
There's no direct way to access them in matlab. You probably could go through Java, or if on Windows, through .Net, but probably...

9 years ago | 0

| accepted

Load more