質問

How to overlay a log-plot on top of an image

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...

7年以上 前 | 1 件の回答 | 0

回答済み

Dumb mistakes we make with MATLAB.

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

Dumb mistakes we make with MATLAB.

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

7年以上 前 | 1

解決済み

Return the 3n+1 sequence for n

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...

8年弱 前

解決済み

Create times-tables

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...

8年弱 前

解決済み

Remove any row in which a NaN appears

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...

8年弱 前

解決済み

Make a checkerboard matrix

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...

8年弱 前

解決済み

Find all elements less than 0 or greater than 10 and replace them with NaN

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

8年弱 前

解決済み

Determine if input is odd

Given the input n, return true if n is odd or false if n is even.

8年弱 前

解決済み

Times 2 - START HERE

Try out this test problem first. Given the variable x as your input, multiply it by two and put the result in y. Examples:...

8年弱 前

質問

Functional form of the colon (:) operator?

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...

8年弱 前 | 4 件の回答 | 0

質問

mex debugging, integer division cause crash?

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...

8年弱 前 | 1 件の回答 | 1

回答済み

about parfor and spmd speedup

So the spot where parfor can really shine is loops that are : a)Simple enough that parfor can do them in parallell b)complex/n...

about parfor and spmd speedup

So the spot where parfor can really shine is loops that are : a)Simple enough that parfor can do them in parallell b)complex/n...

8年以上 前 | 0

質問

poor MATLAB 2011b performance on OSX 10.6

I tend to use debug mode a lot, step into code, test temporary stuff in the command window while at a break-point etc. On any wi...

8年以上 前 | 1 件の回答 | 0

回答済み

FFT / IFFT question .

Actually: >> ifft([1 2 3 2 1], 'symmetric') ans = 2.2000 -0.5236 -0.0764 -0.0764 -0.5236 >> ifft([1 2 3 ...

FFT / IFFT question .

Actually: >> ifft([1 2 3 2 1], 'symmetric') ans = 2.2000 -0.5236 -0.0764 -0.0764 -0.5236 >> ifft([1 2 3 ...

8年以上 前 | 0

質問

Explicitly specifying line colors when plotting a matrix

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...

9年弱 前 | 4 件の回答 | 5

質問

ifft of symmetric data: do I need to provide the redundant input?

Is it possible to lure ifft(X,[],'symmetric') into working on only the non-redundant input? It seems that the low-level FFTW ...

9年弱 前 | 0 件の回答 | 0

質問

load() into workspace?

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...

9年弱 前 | 2 件の回答 | 0

回答済み

Fast calculation of short cumulative product vector

Thank you for all your help. There seems to be many different ways to accomplish this, each with different speed-tradeoffs. The ...

Fast calculation of short cumulative product vector

Thank you for all your help. There seems to be many different ways to accomplish this, each with different speed-tradeoffs. The ...

9年弱 前 | 0

質問

Fast calculation of short cumulative product vector

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...

9年弱 前 | 6 件の回答 | 1

回答済み

Writing elegant MATLAB code

Regarding question#2: idx = []; period = 10; duty_cycle = 3; for i=0:length(x) if rem(i,period) < duty_cycle ...

Writing elegant MATLAB code

Regarding question#2: idx = []; period = 10; duty_cycle = 3; for i=0:length(x) if rem(i,period) < duty_cycle ...

約9年 前 | 0

質問

Writing elegant MATLAB code

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...

約9年 前 | 5 件の回答 | 0

質問

Export figure is painfully slow. Save as png is fast. Why?

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

約9年 前 | 1 件の回答 | 0

回答済み

Increase the speed of the program

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

Increase the speed of the program

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

9年以上 前 | 1

回答済み

What frustrates you about MATLAB?

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...

What frustrates you about MATLAB?

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...

9年以上 前 | 4

送信済み

Image3

A simple function for displaying 3-d arrays similar to how image() can be used for 2-d arrays.

9年以上 前 | ダウンロード 4 件 |

回答済み

ploting a file with variable name

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...

ploting a file with variable name

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...

9年以上 前 | 1

| 採用済み

回答済み

Simple visualization of a 3-d array (volumetric?)

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...

Simple visualization of a 3-d array (volumetric?)

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...

9年以上 前 | 0

| 採用済み

質問

Simple visualization of a 3-d array (volumetric?)

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...

9年以上 前 | 4 件の回答 | 0

質問

Define shared subfunctions inside a classdef *.m file?

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...

9年以上 前 | 2 件の回答 | 0

質問

multidimensional colon operator?

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...

9年以上 前 | 2 件の回答 | 3