Answered
Reshape multiple dat files
I'm assuming that within the same file, the number of -9 between each variable is constant: V = [1 2 3 4 -9 -9 -9 -9 5 6 7 ...

9 years ago | 0

Answered
convert a nested struct in a matrix
Assuming that all your structures have the same fields in all the substructures: alltdata = [userTouristicTraj.touristicDat...

9 years ago | 0

| accepted

Answered
How can I loop this endless if conditions
There's a lot I don't understand about your code (why is A an n x t matrix when you only use the first column?, why is x an n x ...

9 years ago | 0

Answered
How to input name from the user using loop and simple input functions
A matrix of characters, like any other matrix, must have the same numbers of columns for all the rows. Your first assignment to ...

9 years ago | 2

| accepted

Answered
How to detect RGB values from a ROI into the whole image?
You don't need a loop, not even |arrayfun| to do what you want. You basically want to find which elements of one set (the full i...

9 years ago | 0

| accepted

Answered
How can I make matlab editor wrap long comments?
Below the setting you mention, there's a setting _Wrap comments automatically while typing_. Have you checked that box?

9 years ago | 0

Answered
Find rows and extract fra txt file
1. Import your file with, |dlmread|, |readtable|, or the method of your choice. M = dlmread('somefile', 'delimiter', ';'); ...

9 years ago | 0

| accepted

Answered
How can I subtract certain values from a matrix depending on another matrix?
If I understood correctly, this would be one way of doing it: [~, order] = sort(d, 'reverse'); result = p - r(order(1), ...

9 years ago | 0

Answered
how to deal with this error??
The fact you're getting an error shows that you're using an older version of matlab. In R2016b and later, there would have been ...

9 years ago | 0

Answered
open a transparent png and a jpg background together on a single graphical window
bgimage = imread('e8b66924592e1115398fe4a53bd6415c.jpg'); imshow(bgimage); hold on; %so the second image is displaye...

9 years ago | 3

| accepted

Answered
How can I split a vector?
As you haven't answered Walter's answer it's difficult to know what you want exactly. Assuming you want to split your vector in ...

9 years ago | 4

| accepted

Answered
multiplication of two 8bit number
Well, if you'd tested your code with the <https://www.mathworks.com/help/matlab/matlab_prog/debugging-process-and-features.html ...

9 years ago | 0

Answered
Web scraping with regular expression, getting rid of html tags.
The first part of your expression is a look-ahead. You want a look behind instead. Add a |<| before the |!|: regexp('qu <qa...

9 years ago | 0

| accepted

Answered
complex nested for loop
I've not tried to understand your code much but this looks very suspicious: maxCoeff=0; %... newCoeff=corrcoef(.....

9 years ago | 0

Answered
How can I change the LSBs of consecutive elements of an array?
The third argument of |bitset| must either be the number 0 or 1 or a char array representing a valid type (such as 'uint8'). You...

9 years ago | 0

Answered
What is wrong with following code?
x(1) = x; There are two possibilities: * x is scalar, i.e. it has only one element. In which case, the above is simply a...

9 years ago | 0

Answered
easy if statement not working
Look at the result of dbZ_Mask == 66 Notice that it is a logical array. As stated in the <https://www.mathworks.com/help...

9 years ago | 1

| accepted

Answered
Accessing to Parent folder problem
|mkdir| will create all intermediate directories if necessary, so you can create the whole hierarchy with just one |mkdir| by pa...

9 years ago | 0

Answered
Why my code doesn't work?
I've not tested your code but to me it does not look that it's going to produce the right result for any value. For a start,...

9 years ago | 1

| accepted

Answered
Linear indexing for a portion of a matrix, notice that this is not trivial usage of sub2ind!
Well, it is trivial to convert subscripts into linear indices without |sub2ind|, it's just |rowindex + (colindex - 1) .* numbero...

9 years ago | 0

| accepted

Answered
How do you write to excel a cell array that contains both strings and numbers?
Just pass your cell array to <https://www.mathworks.com/help/matlab/ref/xlswrite.html |xlswrite|>, nothing more complex. ...

9 years ago | 0

Answered
substitution of values if is verified a condition
This should work: for userTouristicTrajidx = 1:numel(userTouristicTraj) for touristicDataidx = 1:numel(userTouristicTr...

9 years ago | 0

| accepted

Answered
If I have a vector [1 2 3] and I want all combinations of these values along 6 elements so I will have (3^6) combinations in one vector, How can I do?
Most likely there's already an implementation on the <https://www.mathworks.com/matlabcentral/fileexchange/?s_tid=gn_mlc_fx File...

9 years ago | 1

| accepted

Answered
How can I generated a matrix that I can export to excel for a series of nested for loops?
If you're really hell bent on keeping your hierarchy of tables then indeed a database would be the way to go. In my opinion, it'...

9 years ago | 0

| accepted

Answered
finding the average of each 100 points out of 1000000 data points?
For 1.: avgwave = mean(reshape(yourwavevector, 100, [])); I have no idea what it is you're asking with 2.

9 years ago | 0

| accepted

Answered
Upgrade Matlab to 2017
That all depends on your license. If you have a student license, then yes you need to buy R2017b. If you have a license that's u...

9 years ago | 0

Answered
Select specific elements in cell matrix
Your |aux|, |cf| portion is one confusing piece of code, which I assume could all be replaced by: cf1 = reshape([prop{f}.Ce...

9 years ago | 0

Answered
i want to change the result in the following code that instead of result 1 2 3 4 5 give me a b c d e
Tip: a bunch of |if ... else| statements is rarely a good way to solve problems. The most straightforward way to obtain your ...

9 years ago | 0

Answered
Import only certain columns (with numeric values) from multiple text files with complex name
1. _"Unfortunately, for those months, the software which generated the text files, add a "0" at the left of the month field"_. T...

9 years ago | 1

| accepted

Answered
Create a function - with cross reference
Your question is a bit thin on details (like what format are the inputs in, what it is exactly you want to calculate, etc.). The...

9 years ago | 0

Load more