Réponse apportée
create a vector whose elements depend on its previous elements without a loop
Doing this will a loop shouldn't be slow as long as you preallocate the array beforehand: a = zeros(1, 100); %preallocation a...

environ 7 ans il y a | 1

| A accepté

Réponse apportée
Find the difference between rows and substract it
I'm not sure how that is diferent from shiftng to 0, but to achieve what you want: shift = Amtx1(1, :) - min(Amtx1(1, :)); plo...

environ 7 ans il y a | 0

| A accepté

Réponse apportée
Rename files within multiple subfolders (within multiple subfolders) to the name of the first subfolder.
You just need to break down the mydir.folder into its different folders and use the one before last to rename your file.: dir_p...

environ 7 ans il y a | 0

| A accepté

Réponse apportée
Edit header of MAT-File
Ok, you could theoretically store some limited metadata in the header of a version 5 mat file. It's been a while now that matlab...

environ 7 ans il y a | 0

Réponse apportée
How to find the peaks without using findpeaks function?
There are several alternatives to the Signal Processing Toolbox findpeaks on the file exchange. This one and this one are the f...

environ 7 ans il y a | 0

Réponse apportée
Use one matrix to change values of another
Simply: B(~ismember(B, A)) == 0

environ 7 ans il y a | 1

Réponse apportée
Google number of occurences
This doesn't seem to be a question about matlab (much). If you want to use google, you'll have to go through their custom search...

environ 7 ans il y a | 1

Réponse apportée
Access multiple folders and extract specific files
Doesn't sound particularly complicated. For a while now, dir has been able to recurse into folders, so a single filelist = dir(...

environ 7 ans il y a | 0

Réponse apportée
Regexp to pull numerics only
\d*\d*\d*\d* is exactly the same as \d*, match 0 or more digits. It probably would be better as \d+, match 1 or more digits Tha...

environ 7 ans il y a | 0

| A accepté

Réponse apportée
Transfer a diagonal matrix
Please, don't post screenshot for something as simple as a matrix. Use text, so we can copy/paste it into matlab. A = diag(1:3)...

environ 7 ans il y a | 0

| A accepté

Réponse apportée
Importing table/array from website to Matlab
First, note that importing data from html is always going to be very iffy. html is a presentation format designed to display thi...

environ 7 ans il y a | 0

| A accepté

Réponse apportée
setvartype does not work
As it says on the 3rd line of the documentation, opts = setvartype(opts,type) "updates all the variables in the opts object ..."...

environ 7 ans il y a | 1

| A accepté

Réponse apportée
Decode JSON into only struct array
jsondecode is certainly never going to convert a json array into a structure array as there's no guarantee that the objects in t...

environ 7 ans il y a | 2

| A accepté

Réponse apportée
Using color in strings in MATLAB AppDesigner in UITextArea
Unfortunately, no the control is not flexible enough to allow this. On the other, text area controls are more tailored for inp...

environ 7 ans il y a | 1

Réponse apportée
How can I replace this a value in the array with the k where the value is k-th min?
This is the simplest: v = [1 434 22 434 23 53 89 199] [~, ~, newv] = unique(v)

environ 7 ans il y a | 1

| A accepté

Réponse apportée
Which way of programming is more efficient and faster?
No, there is no difference between the cases. More importantly, even if there was, you shouldn't care until you've proven that t...

environ 7 ans il y a | 1

| A accepté

Réponse apportée
Index exceeds the number of array elements (0).
Yes, you will receive this error whenever your dir doesn't find any file. Three things: Use meaningful variable names, dirconte...

environ 7 ans il y a | 2

| A accepté

Réponse apportée
Gray Color Intensity fill.
Note that AFR should hav one less row as well as column. Probably, the simplest way to create your spray: pdata = surf2patch(S...

environ 7 ans il y a | 1

| A accepté

Réponse apportée
How to get the sum of several sets of nonzeros in array
Here is one way: %demo data v = [0 0 0 0 2 4 1 0 0 1 5 3 0 0 0 0 2 3 0 0 7 2 3 1 2 0 0 0 0]; endruns = find(diff([v~=0, 0])...

environ 7 ans il y a | 0

| A accepté

Réponse apportée
Overwrite a CELL-ARRAY
As Geoff said, at the moment this line vtec_final{1,i} = vtec_pronosticado2 ; doesn't make much sense. We have: for i=1:punt...

environ 7 ans il y a | 0

Réponse apportée
How to be able to read file names with Swedish characters (ÅÄÖ) from a zipped file? Also how to unzip the files to a folder with the same name as the zipped folder?
The documentation of unzip is a bit unclear on the effect of locale, all it has to say is "To extract a zip file that contains n...

environ 7 ans il y a | 0

Réponse apportée
Accessing the index of a matrix element inside the cell array
First, a few recommendations. If you're using vectors use linear indexing instead of 2D indexing. I.e. X{1} instead of X{1, 1}...

environ 7 ans il y a | 1

| A accepté

Réponse apportée
degrees2dms Syntax
function(x) = y has never and never will be valid syntax in matlab. A function call is always on the right hand side of the =. ...

environ 7 ans il y a | 0

| A accepté

Réponse apportée
Error:- Index in position 1 is invalid. Array indices must be positive integers or logical values.
Note that the whole code can be simplified to: function [ irradianceReorder ] = reOrderNew(irradiance, xMoved, yMoved, zMoved) ...

environ 7 ans il y a | 0

Réponse apportée
A file called avehighs.dat stores the average high temperatures for each month for a year (rounded to integers). The first column of the data stores the zip code, the 2nd to 13th columns store 12 temperatures.
If there was 100 zip codes, would you write a 100 elseif ? What if there was a million? Clearly that's not the way to go You ac...

environ 7 ans il y a | 0

Réponse apportée
Return the Coordinates of the differences
Sounds like you're doing image registration. Have you considered looking at the functions that matlab already provides? There's ...

environ 7 ans il y a | 0

Réponse apportée
How to plot according to DropDown menu value?
if value == Square Well, this is certainly not going to work (unless you've created a Square variable) I suspect that if valu...

environ 7 ans il y a | 0

Réponse apportée
Help!!! how to search for some xx xx xx xx(hex) in a dat file very fast!!!
Unlike per isakson, I'm assuming that you're looking for a byte pattern (given in hexadecimal format) in a binary file. If you'r...

environ 7 ans il y a | 1

| A accepté

Réponse apportée
How to make my function accept input file?
What should be done? I'm afraid the answer is: learn matlab. Function inputs are variables. Matlab is not going to magically gu...

environ 7 ans il y a | 2

Réponse apportée
The sequence of actions in a vector (football match)
No idea how we went from your original question to a vector of numbers. Anyway, if I understood correctly: %example data match...

environ 7 ans il y a | 1

| A accepté

Charger plus