Community Profile

photo

Sindar


Last seen: 1 day ago

University of Colorado Boulder

284 total contributions since 2018

Contact

Sindar's Badges

  • Knowledgeable Level 4
  • Pro
  • 6 Month Streak
  • Revival Level 2
  • Introduction to MATLAB Master
  • Community Group Solver
  • Solver
  • First Answer

View details...

Contributions in
View by

Answered
Efficient Method for Multiple Gridded Interpolation
I don't know how fast it will be, but I think this'll work % lon and lat are read from a netcdf file lon = ncread('important_g...

1 day ago | 1

Answered
'LineWidth' parameter not affecting marker thickness of animated line
According to the documentation, 'LineWidth' should change the markers as well, so it may be a bug. Regardless, try 'MarkerSize' ...

1 day ago | 0

Answered
how to add labels to the elements of a vector.
One option: store things in a table. This particular setup may not be the most efficient, but hopefully it helps you start: %...

1 day ago | 0

Answered
Find the equality of each value in the vector and cell array
% better test data A = {1;[];1;[1 4];3}; B = [1;4;10;4;3]; temp = zeros(length(B),1); for i=1:length(B) % isequal handl...

21 days ago | 0

| accepted

Answered
Overwriting information in a cell array
Braces access cell contents, allowing you to update (in this case, appending to the end and hoping it's a compatible shape) Bra...

21 days ago | 0

| accepted

Answered
Simulate single sine wave
Without the noisy signal? See sin documentation. With the signal (i.e. fitting to it), check out the answer to this question

22 days ago | 0

Answered
How can I fix "Index in position 2 exceeds array bounds" in for loop/ if statements?
Okay, I believe this code is equivalent to what you have, cleaner and without the error % pre-allocate with cell arrays of [] ...

25 days ago | 0

| accepted

Answered
This is function to help
Whether this can be vectorized is really a question about SD. It's possible it works on columns straight off: Val = SD(VImage,Q...

25 days ago | 0

Answered
What is missing from MATLAB #2 - the next decade edition
Ok, this is pretty minor, but: For common functions that return values as the first output and indices as the second, it would ...

25 days ago | 0

Answered
Indices of 2D array
data =[ 2 5 0 15 12 7 4 8 19 14 20 25 18 13 40 ]; reshaped_data = reshape(data,3...

26 days ago | 1

| accepted

Answered
Potting graphs with if else and for
If it throws an error, please include that information. If that error is what I'm seeing: Error using plot. Vectors must be th...

26 days ago | 0

| accepted

Answered
extracting information from tall timetable using a loop
Looks like you could do everything with groupsummary, assuming you can figure out how to define the bins G = groupsummary(TT,'T...

1 month ago | 0

| accepted

Answered
Trying to create a matrix by nesting a for loop in another for loop
No need for loops, except if effectiveness doesn't accept arrays % nx1 NTU = (2.5:0.1:3.5).'; for i=1:length(NTU) eff(i)...

1 month ago | 0

| accepted

Answered
Faster Looping for Griding/Binning Data
check out discretize

1 month ago | 0

Answered
How to plot phase and amplitude spectrum after doing fft?
See this example for in angle documentation

1 month ago | 0

Answered
Convert from cell of a table to an array
It gets tricky with different variable types and widths, but hopefully this helps. Worst case, you build up the new table elemen...

1 month ago | 0

| accepted

Answered
CREATE HISTOGRAMM WITH A SPECIFIC NUMBER OF CLUSTERS IN X AXIS
histogram: x = randn(1000,1); nbins = 5; h = histogram(x,nbins)

1 month ago | 0

Answered
Z must be a matrix, not scalar or vector - SURF
struct array is a terrible way to store this data. Does this do it? tbl = struct2table(b); surf(tbl.temperature,tbl.humidity,t...

1 month ago | 0

| accepted

Answered
Projectile motion using while loop Time of flight
Basically, the issue is that you are only updating a small portion of the relevant variables each time step. A few questions Is...

1 month ago | 0

| accepted

Answered
plotting a function correctly
x=[-2:0.1:2]; y = exp(-x)-x; plot(x,y)

1 month ago | 0

| accepted

Answered
what is the code for bin histogram of fraction to the bin
You can specify the histogram edges like this, with the height of the bars normalized to %: x = randn(1000,1); edges = 25:5:50...

1 month ago | 0

Answered
Plotting Phase angle in Matlab
First off, "load" is for Matlab files, not raw text. Check out textscan. If your code isn't error-ing, you probably have old ver...

1 month ago | 0

Answered
Change histogram to more bars
histogram accepts the number of bins as a second argument: x = randn(1000,1); nbins = 25; h = histogram(x,nbins)

1 month ago | 1

| accepted

Answered
What is this code doing?
Short version: copy a list of Matlab script/function files from wherever Matlab finds them into a particular directory ('C:\TEMP...

1 month ago | 0

| accepted

Answered
Extracting data from an array
To extract the first three rows: B3 = B(1:3,:); x = B3(1,:); y = B3(2,:); z = B3(3,:); But, if B is really 4x1, then you on...

1 month ago | 0

Answered
can anyone find the error?
Perhaps you are calling the function with two few arguments, such as this on the command line: quadraticc(2) If you are simply...

1 month ago | 0

| accepted

Answered
Sort and extract elemets from a structure.
tables are a vastly superior way of handling this data. Does this do it? mydata= readtable('mytext.txt'); sorted_data = sortro...

2 months ago | 0

| accepted

Answered
How to extract values from each structure in the .mat file
keeps the names, but as fieldnames in a new struct, signals, rather than variables (see Walter's comment): data = load('data.ma...

2 months ago | 1

| accepted

Answered
Changing the size of an array in a while loop
keeps the vector the same length A_i = gradient(A_0,dt).*I.^2; changes size of vector (and uses a for loop since there are a...

2 months ago | 0

| accepted

Answered
I have the following Matlab code that produces a x2 zoomed image of the input using Pixel Replication. How can I change it to shrink an image?
throw out every other row and column: img1 = imread(filename); N = img1(2:2:end,2:2:end);

2 months ago | 0

Load more