Community Profile

Contact

Top 5% contributor

Hi. I was not entirely sure what you were requesting, so I choose to do some interpretation. The snip below will load a stand...

accepted

1

Answered 2 years ago

The fact that once you schedule a low-level function, you cannot in any way stop it. Such as conv(zeros(umpteen,1), ones(umpteen...

3

Answered 4 years ago

6 downloads

4 years ago

If you use the {} Code tags, you will make the code a lot more readable for other users, and increase the chance that someone bo...

I want to do something like that below: copy an N-dimensional array into a N+1-dimensional array at index t in the last dimensio...

2 Answers

Asked 4 years ago

am calling a *.p file that has hard-coded text output. This is adding noise to my scripts. Is there any way to call a function ...

4249 views

Posted 5 years ago

I want to calculate a reasonable short vector many times with variable inputs a and len %y = [a a^2 a^3...a^(len)] My method...

6 Answers

Asked 3 years ago

I use image(sc) a lot for visualizing the contents of any 2-d array that I may be working on. Sometimes I am working on 3-d arra...

3 Answers

0

If I place load() into a m-file script, it will load into the workspace, available for the caller. If I place it into a m-fil...

I have a great interest in writing my MATLAB code the "right" way. I want it to be compact, readable and fast. As such, I have a...

5 Answers

I want to define a relatively small class (small enough that it makes sense to do everything inside of one file). I want to reus...

Here is my suggested solution. Nothing ground-breaking, but a bit fiddly for my skills using axes. %%generate some trivial d...

for i = 1:3 disp(exp(i*pi)); end Instead of: for i = 1:3 disp(exp(1i*pi)); end

Whenever I see a "for" statement in MATLAB, I question myself if that operation can be vectorized. Is it possible to use dlmread...

Thank you for your answers, but I was not able to use them for my thing. In the end, I wrote a small script for myself that is c...

I want to have a script compile my mex file using different options depending on what compiler is set up. Passing switches seems...

1562 views

Here is the use-case: You have access to an image of a MATLAB semilogx() plot from a paper, a website or something similar. The...

1 Answers

Asked 2 years ago

x = 1:3; y = [1 2 3; 42 40 34]; plot(x,y,'Color', [0.5 0.5 0.5; 1 0 0]) produce an error: Error using plot Co...

2

I tend to export some figures for use in presentations etc. I have noticed that for some figures (perhaps those with lots of dat...

I have got a 3-d matrix that I want to visualize. I would like each element of the array to correspond to a 3-dimensional "voxel...

1281 views

Posted 4 years ago

I want to capture and process audio in realtime using playrec. At the same time, I want visual feedback. Problem is, any plot co...

1239 views

Thank you, I just learned this myself :-) But it still seems like a waste of bandwidth to have to copy a vector into something ...

1218 views

Responded 3 years ago

I want to do the IFFT of a conjugate symmetric vector. Is it possible to do the IFFT of the first (non-redundant) coefficients, ...

Posted 3 years ago

This is a post about "how to write neat, efficient, readable MATLAB code". I get the job done by doing work-arounds, but I would...

Obviously, I am doing something wrong, and my code is too complex to repeat here. I have tried to distill the parts that seems p...

A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is e...

Solve this!

2 years ago

At one time or another, we all had to memorize boring times tables. 5 times 5 is 25. 5 times 6 is 30. 12 times 12 is way more th...

Given the matrix A, return B in which all the rows that have one or more <http://www.mathworks.com/help/techdoc/ref/nan.html NaN...

Given an integer n, make an n-by-n matrix made up of alternating ones and zeros as shown below. The a(1,1) should be 1. Example...

Given an input vector x, find all elements of x less than 0 or greater than 10 and replace them with NaN. Example: Input ...

Load more