Réponse apportée
Specific values in an Array
R=[]; for i=1:1:5 for y=5:1:10 eq1=i*y; %% To save the values: R=[R; i y eq1]; end end a...

plus de 4 ans il y a | 1

Réponse apportée
Auto fetch input files to process from a specified folder
"I have a lot of data files that I would like to process through my code [...] each file from a specified folder one at a time" ...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
Plotting a limited number of elements
"plot the first 5" An if-statement should do that. Replace plot(jvals(i,:), vetor_momentoj(i,:), '-o'), hold all by if i <= ...

plus de 4 ans il y a | 1

| A accepté

Réponse apportée
How to modify a function handle?
That's simpler than you thought %% f1 = @(y) y; f2 = @(y) f1(y)*2; %% f2(5)

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
Storing variables in a for loop within another
"store the variable "vetor_momentoj" [...] in terms of the indexes i and j." Something like this? I replaced the calculation of...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
Calculate with initial value
There is nothing that terminates the execution of the loop when convergence is reached. Thus, the while-loop will run until the ...

plus de 4 ans il y a | 1

| A accepté

Réponse apportée
How to save data from a file with text and numbers?
"load this file and save lines starting from 'Step' to 'ID Type' to another file" Including the "ID Type" block - or not ? Thi...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
what's wrong with this "IF" in the code below?
Cannot tell based on the info of your question. Show full error message. Set Pause on Errors Run the code. Execution will h...

plus de 4 ans il y a | 1

Réponse apportée
how to delete data with special value in an array?
"to delete the value" Do you mean remove? If so, try this script which uses logical indexing %% vec = 1+2*randn( 1, 800 ); %...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
conversion of date from yyyymmddHHMMSS format to yymmddHHMMSS format.
vec = datevec( '2020,07,23,00,00,00', 'yyyy,mm,dd,HH,MM,SS' ); datestr( vec, 'yymmddHHMMSS' ) or did you mean datestr( vec, '...

plus de 4 ans il y a | 0

Réponse apportée
I am getting "Too few input arguments." error. How can i solve it?
See Not enough input arguments. And see narginchk - Validate number of input arguments.

plus de 4 ans il y a | 0

Réponse apportée
Trying to see if a variable is an integer or not
Try this %% x=2.5; answer = ( x == floor(x) )

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
Not enough input arguments.
You need to call the function, Lorenz, with two input arguments: t and x. E.g. %% x = (1:6); t = nan; xprime = Lorenz( t, x...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
Help indexing: How to index at the interfaces of cells and not the cells
Index in position 2 exceeds array bounds U(:,j+2) is most likely the problem. I assume that the size of U is NEQxN. The max...

plus de 4 ans il y a | 1

| A accepté

Réponse apportée
Problems in reading large matrix with large empty cells
This script reads your sample file %% opts = fixedWidthImportOptions('NumVariables',36,'DataLines',4,... 'VariableNames',{'IN...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
out of memory error for large data
See How to export complex-valued matrix to HDF file

plus de 4 ans il y a | 0

Réponse apportée
Error: Not enough input arguments
Accourding to the definition function [ U_RK ] = RK4( U_T, Res, dx, dt, k, N ) requires six input values. Your call of the fun...

presque 5 ans il y a | 0

| A accepté

Réponse apportée
Best Matlab Editor replacement?
I have not always been loyal to the Matlab editor (ME) Long time ago I used the full version of the ED editor that comes (or di...

presque 5 ans il y a | 1

| A accepté

Réponse apportée
Getting error while deleting every row of the matrix M that contains the variable x
The trick is to iterate in reverse order, i.e a:-1:1 instead of 1:a. Try this %% M = magic(5); x = 13; N = Delete_var(x,M) ...

presque 5 ans il y a | 0

| A accepté

Réponse apportée
How to remove both leading and trailing zeros from a binary string?
Is this what you look for? %% A=["00000001111";"00000110010";"10111011100";"00001000110";"11111010000";"00000001010"]; %% B ...

presque 5 ans il y a | 0

| A accepté

Réponse apportée
[DISCONTINUED] MATLAB Answers Wish-list #5 (and bug reports)
I wish Answers would automatically reject comments like "I did that but it didnt work"

presque 5 ans il y a | 4

Réponse apportée
I want to read a bunch of files inside a loop function in MATLAB, but when I try the following code:
What do you suppose that the following statement will do? j = (i * 2000000); Replace A = dlmread('gr_at_0.l_%d', j); by A =...

presque 5 ans il y a | 0

Réponse apportée
unable to make directory in specified folder
"it won't recognize this slef-made folder" Did you add it to Matlab's search path? On my system, R2018b,Win10, your script wo...

presque 5 ans il y a | 1

Réponse apportée
How to import a function from another package
Your folder, Model, is not a Matlab package. Package folders always begin with the + character. See Packages Create Namespaces....

presque 5 ans il y a | 0

| A accepté

Réponse apportée
Split a string into 4 character groups?
"Split a string into 4 character groups?", "split this output string into groups of characters" and "I want to group at this sta...

presque 5 ans il y a | 0

| A accepté

Réponse apportée
Please, help with Matlab code
Your function works just fine longestword("Heat","Lakers","Warriors") longestword("cent","centennial","century") longestword(...

presque 5 ans il y a | 1

Réponse apportée
How to read in large text file with special delimiters?
"Is there any way to specify your own row and column delimiters to be able to read in this data?" No, I don't think so. How la...

presque 5 ans il y a | 1

| A accepté

Réponse apportée
Nested elseif statement syntax
There is no else block in the outer if-elseif-else-end. This code will display something only for inputs(1)==0 and for inputs(1)...

presque 5 ans il y a | 0

Réponse apportée
how to simulate different investments
Based on your question, I've made a small object oriented demo. You don't prescribe how many shares an investor will trade in...

presque 5 ans il y a | 0

Réponse apportée
can anyone help me prepare the code
Problems with your script The long lines make the code hard to read. Numerous statement separators are missing I added line ...

presque 5 ans il y a | 0

Charger plus