About 20,800,000 results
Open links in new tab
  1. save values in array in a loop - MATLAB Answers - MATLAB

    Jun 22, 2022 · I want to save a value calculated inside a loop in an array. Is it possible? for example: for i=1:10 s=a+b; a(i)=s; end a ans= a=[23 45 678 21 34 134 34 56 1...

  2. how to save variables to an array using a for loop?

    Jun 29, 2017 · So the best and simplest solution is to put that data into one variable when you make those calculations. That is what any experienced user would do, and you can do that too.

  3. Storing variables in array in matlab - Stack Overflow

    May 19, 2014 · I have to calculate the variable x, store it as x1. Calcute the x with different conditions and store it as x2 etc. The problem I have that I would have to manually change all the x 's in my code to x2 , x3 , x4 etc.

  4. How can I store symbolic variables and symbolic functions in a array

    If they do all use the same set of variables as arguments, then instead of creating an array of functions, MATLAB will create a single function that returns an array. MATLAB uses the same syntax of round brackets for indexing and function calls.

  5. matlab - How to store variable length arrays? - Stack Overflow

    Oct 8, 2014 · I want to store an array which changes its size in each iteration of a for loop. For example, for y=1:100 for x=1:50 . . ms(:,x,y) = ans; . . end end The 'ans' is a row vector which changes its size in each iteration of y. How can i store these variable length 'ans' into ms?

  6. Create array of variables in Matlab - Stack Overflow

    Apr 25, 2012 · In the M-file "matrixT.m", i wrote the function matrixT to generate a n*3 matrix like that function T=matrixT (alpha,n) T=zeros (3,n); for i=1:n T (1,i)=cos (alpha (i)); T (2,i)=sin (alpha (i)); ...

  7. How do i create variables that store arrays - MATLAB Answers - MATLAB

    May 17, 2022 · I want the array to have A(1) and A(2) store a matrix of vector variables as t increases by 1.

  8. How to store loop values into array? - MATLAB Answers

    Dec 17, 2014 · for i=1:3689 b=bret (1,10000*q (i,1)-9999:10000*q (i,1)) sel= (max (b)-min (b))/3.3 y=peakfinder (b,sel) p=size (y,2) for j=1:p-1 v (1,j)= ( (y (1,j+1)-y (1,j))) end; * SYNTAX …

  9. How to store values in an array in MATLAB - Stack Overflow

    Sep 30, 2013 · I tried the following method by I keep getting an empty matrix.... fmin = 60; fmax = 1000; region_of_interest = fmax>f & f>fmin; froi = f(region_of_interest); [p_max,loc] = max(seg_fft2(region_of_interest)); p_max; fpeaks = froi(loc); [points, locatn] = findpeaks(seg_fft2(region_of_interest)); if points > 0.4*p_max.

  10. How Do You Save an Array in MATLAB: A Complete Guide

    Saving arrays in MATLAB involves straightforward functions and file formats that enhance data management and workflow efficiency. Here’s how to effectively save arrays for better working practices. Using the save Function

  11. Some results have been removed
Refresh