Answered
Regular expressions: extracting data after certain keywords
For such a large file I would get textscan to directly import the numeric data. With a few simple file commands you can also aut...

5 years ago | 0

| accepted

Answered
Executing the body of IF statement.
Solution: the logic is incorrect: ~ii==attack should be ii~=attack Explanation: the code ~ii==attack following the rules o...

5 years ago | 1

| accepted

Answered
How to define a struct array with length more than one and assign values to one of the strucy array?
>> A = [1,0.2,3,0.4,5,6]; >> X = [1,3,4,6]; % "I only want to save these four values" >> Ac = num2cell(A); >> Bc = num2cell(A...

5 years ago | 0

| accepted

Answered
store a huge number of rows in a in a matrix (out of memory error)
"I searched through the internet and become familiar with tall matrix but as far as I understand that matrix is just read-only.....

5 years ago | 0

Answered
substitute of persistent command
You could use nested functions for this: function main() sij = []; Tj = [] esj = []; ej = []; .. etc. [yo_new,ypo_new] ...

5 years ago | 1

Answered
Writing result of script (ran in a loop) into vector
Something does not make much sense: given NumOfRuns = 3, why does results have 26 columns? I suspect that the script also conta...

5 years ago | 0

Answered
Loop over an array or list of vectors
While it is possible to loop over array elements directly, in practice it is usually much more convenient and versatile to loop ...

5 years ago | 2

| accepted

Answered
indexing a field in a structure
Your indexing is not correct. If s(11).structure has exactly 270 elements, then all you need is this: out = [s(11).structure.Me...

5 years ago | 0

| accepted

Answered
Should be easy but I keep getting errors. I want to input the array through a function that I already have generated through equations then plot it.
As the ode45 documentation explains here (with examples): https://www.mathworks.com/help/matlab/ref/ode45.html#bu3uhuk the cor...

5 years ago | 0

Answered
2d array and 1d array
N = 3; DecodeData = nan(N,55); for k = 1:N TempStorage = ... whatever defines your 1x55 vector DecodeData(k,:) = Tem...

5 years ago | 0

| accepted

Answered
Combining two different size variables into one matrix
The simplest solution is to download this: https://www.mathworks.com/matlabcentral/fileexchange/22909-padcat and then all you ...

5 years ago | 0

| accepted

Answered
Save Structure to .mat-file in dialog via GUI
S = .. your big structure [F,P] = uiputfile('*.mat'); save(fullfile(P,F),'-struct','S') % if S is scalar save(fullfile(P,F),'...

5 years ago | 0

| accepted

Answered
Vertical concatenation of structure fields (compact form)
Your example concatenates horizontally because it is exactly equivalent to doing this: [structure(1).field,structure(2).field] ...

5 years ago | 0

| accepted

Answered
How to store partially known datetimes
I don't believe that information can be encoded inside one datetime object, so you will have to use another object or variable t...

5 years ago | 0

| accepted

Answered
How can I assign a value to variable using buttons?
I think writing your own GUI is a red herring. Unless it really is your goal to learn all about asynchronous code, callback func...

5 years ago | 1

| accepted

Answered
Converting a Data Array into a Larger Array Given a Logical Array
>> idx = logical([1,0,1,0,1,0,0,0,1]); >> dat = [5,3,7,4]; >> out = zeros(size(idx)); % preallocate >> out(idx) = dat out = ...

5 years ago | 0

| accepted

Answered
30x-11= 30/x
Simple numeric solution: >> fun = @(x) 30*x - 11 - 30./x; >> x = fzero(fun,pi) x = 1.2000 Checking: >> 30*x-11 ans = ...

5 years ago | 0

Answered
Make for loop and extract data from different tables within a structure.
You are confusing the field names with an index, but really you should just be using an index. Rather than awkward messing about...

5 years ago | 0

| accepted

Answered
Ode Not enough input arguments.
As the error states, you are not calling the function nozzlesinglebobbgola with enough input arguments: nozzlesinglebobbgola(x,...

5 years ago | 0

| accepted

Answered
given cell array 'cell1', create new cell array 'cell2' with elements of cell1 containing string 'f' and ages >=30 && <=40
age = vertcat(cell1{2:end,3}); ix1 = age>=30 & age<=40; ix2 = strcmp('f',cell1(2:end,2)); cell2 = cell1([false;ix1&ix2],:) G...

5 years ago | 0

| accepted

Answered
Using Dir command together with xlsread troubleshooting
Much simpler: D = 'C:\Users\erik.from\Documents\MATLAB\Event'; S = dir(fullfile(D,'*.xlsx')); for k = 1:numel(S); F = fu...

5 years ago | 0

| accepted

Answered
How do I write a script that calculates and prints all values ​​for N according to the following expressions and limits?
"How do I write a script that calculates and prints all values for N according to the following expressions and limits?" k = ...

5 years ago | 0

| accepted

Answered
How to use nested functions to build a code that compares inputs
The comparison needs to be inside the loop (not after the loop): function result = grader(funA, funB, varargin) result = true;...

5 years ago | 0

| accepted

Answered
Reading textfile using fopen and textscan
This reads your file: opt = {'Delimiter',',', 'CollectOutput',true}; [fid,msg] = fopen('test_file.txt','rt'); assert(fid>=3,m...

5 years ago | 0

| accepted

Answered
Averaging Every Element of some matrices
The simple answer is to concatenate all of your matrices into one array, and then use mean. Of course all of your matrices shoul...

5 years ago | 0

| accepted

Answered
RMS value of periodic signal - using quad/quad8 command - getting an error with 'func' command
Use a function handle, just like the quad documentation states: int_v_sq = quad(@func,a,b);

5 years ago | 0

| accepted

Answered
Imread bit depth is limited to 8 bit?
Most likely you are confusing bits per pixel with bits per color. The .BMP file header contains the bits per pixel, which is ex...

5 years ago | 0

| accepted

Answered
saveas doesn't wait until imcontrast is finished
h = imcontrast(gg); waitfor(h) Simply close the tool when you are finished, the code will then continue executing.

5 years ago | 1

| accepted

Answered
Using the value of the next step in a FOR loop over a vector
"Does anyone has a hint for me how to include the next steps of the for loop into the formula?" In MATLAB it is much better to ...

5 years ago | 1

| accepted

Load more