Beantwortet
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...

fast 7 Jahre vor | 1

| akzeptiert

Beantwortet
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...

fast 7 Jahre vor | 0

| akzeptiert

Beantwortet
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...

fast 7 Jahre vor | 0

| akzeptiert

Beantwortet
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...

fast 7 Jahre vor | 0

Beantwortet
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...

fast 7 Jahre vor | 0

Beantwortet
Use one matrix to change values of another
Simply: B(~ismember(B, A)) == 0

fast 7 Jahre vor | 1

Beantwortet
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...

fast 7 Jahre vor | 1

Beantwortet
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(...

fast 7 Jahre vor | 0

Beantwortet
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...

fast 7 Jahre vor | 0

| akzeptiert

Beantwortet
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)...

fast 7 Jahre vor | 0

| akzeptiert

Beantwortet
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...

fast 7 Jahre vor | 0

| akzeptiert

Beantwortet
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 ..."...

fast 7 Jahre vor | 1

| akzeptiert

Beantwortet
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...

fast 7 Jahre vor | 2

| akzeptiert

Beantwortet
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...

fast 7 Jahre vor | 1

Beantwortet
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)

fast 7 Jahre vor | 1

| akzeptiert

Beantwortet
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...

fast 7 Jahre vor | 1

| akzeptiert

Beantwortet
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...

fast 7 Jahre vor | 2

| akzeptiert

Beantwortet
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...

fast 7 Jahre vor | 1

| akzeptiert

Beantwortet
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])...

fast 7 Jahre vor | 0

| akzeptiert

Beantwortet
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...

fast 7 Jahre vor | 0

Beantwortet
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...

fast 7 Jahre vor | 0

Beantwortet
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}...

fast 7 Jahre vor | 1

| akzeptiert

Beantwortet
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 =. ...

fast 7 Jahre vor | 0

| akzeptiert

Beantwortet
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) ...

fast 7 Jahre vor | 0

Beantwortet
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...

fast 7 Jahre vor | 0

Beantwortet
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 ...

fast 7 Jahre vor | 0

Beantwortet
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...

fast 7 Jahre vor | 0

Beantwortet
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...

fast 7 Jahre vor | 1

| akzeptiert

Beantwortet
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...

fast 7 Jahre vor | 2

Beantwortet
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...

fast 7 Jahre vor | 1

| akzeptiert

Mehr laden