Solved


Quote Doubler
Given a string s1, find all occurrences of the single quote character and replace them with two occurrences of the single quote ...

12 years ago

Solved


radius of a spherical planet
you just measured its surface area, that is the input.

12 years ago

Answered
Can anyone please tell me how to apply load to a wound-rotor Induction machine?
Are you using SimPowerSystems? Go into the help, click on the SimPowerSystems section, and select "Examples" or "Demos". Thi...

12 years ago | 0

| accepted

Solved


Find the longest sequence of 1's in a binary sequence.
Given a string such as s = '011110010000000100010111' find the length of the longest string of consecutive 1's. In this examp...

12 years ago

Solved


Is my wife right? Now with even more wrong husband
Again, as in "Is my wife right?" ( <http://www.mathworks.com/matlabcentral/cody/problems/149-is-my-wife-right> ), answer 'yes' r...

12 years ago

Answered
Euler's Equation for Dummies
You have the statement while y(i)>0 before the loop where i is defined. Perhaps add i=1 before that?

12 years ago | 0

| accepted

Solved


Find the alphabetic word product
If the input string s is a word like 'hello', then the output word product p is a number based on the correspondence a=1, b=2, ....

12 years ago

Solved


Pascal's Triangle
Given an integer n >= 0, generate the length n+1 row vector representing the n-th row of <http://en.wikipedia.org/wiki/Pascals_t...

12 years ago

Solved


Bullseye Matrix
Given n (always odd), return output a that has concentric rings of the numbers 1 through (n+1)/2 around the center point. Exampl...

12 years ago

Answered
Is there a code in matlab for Discrete Tchebichef Transform (DTT)?
<http://en.wikipedia.org/wiki/Discrete_Chebyshev_transform>

12 years ago | 0

Solved


Binary numbers
Given a positive, scalar integer n, create a (2^n)-by-n double-precision matrix containing the binary numbers from 0 through 2^n...

12 years ago

Solved


Nearest Numbers
Given a row vector of numbers, find the indices of the two nearest numbers. Examples: [index1 index2] = nearestNumbers([2 5 3...

12 years ago

Solved


Return the largest number that is adjacent to a zero
This example comes from Steve Eddins' blog: <http://blogs.mathworks.com/steve/2009/05/27/learning-lessons-from-a-one-liner/ Lear...

12 years ago

Answered
how to plot a 3d function (with two independent variables)
ezplot() is a 2d function. ezsurf() will give you 3d. ezsurf(char(eucara),[0 1000 0 1000]) <</matlabcentral/answers/u...

12 years ago | 0

| accepted

Answered
How to create a closed loop with initial solution
You can feedback your previous result using a delay block or memory block. The intial condition for either of these blocks ca...

12 years ago | 1

| accepted

Answered
How to build a model of current transformer for metering?
SimPowerSystems: <http://www.mathworks.com/help/physmod/powersys/ref/saturabletransformer.html> Or something like this fro...

12 years ago | 0

| accepted

Answered
I want to sort the function x^2+2x+1 new population fuctional output.how i will do it?
optimtool('ga') Give it a try and come back if you have a specific question or error you need help with. <http://www.m...

12 years ago | 0

Answered
Regarding the Powersysdomain block in SimPowerSystems
As far as I know, the powersysdomain is proprietary and not friendly to tinker with. I have taken three approaches to custom ...

12 years ago | 1

Answered
How to make a discrete x-y plot with quiver instead of stem
Using quiver() as requested: x= -10:1:10; a= [0,0,0,0,0,0,0,0,0.5,0,0,0,0.5,0,0,0,0,0,0,0,0]; y=zeros(size(x)); v...

12 years ago | 0

| accepted

Answered
while loop not doing what i want?
Your FF never approaches 1. Perhaps you have an error in your function? <<http://snag.gy/limaH.jpg>>

12 years ago | 0

Answered
1D plot with exciting colours
I am going to assume you have a 1d vector for time and a 1d vector for voltage. If not, then please answer Doug's comment above...

12 years ago | 0

Answered
Plotyy changes line style every time in for loop
There are separate 'LineStyle' and 'Marker' settings. 'LineStyle' just changes the Line Property. Valid choices are: {-...

12 years ago | 0

Answered
How to import text files with unrecognized file extensions
Did you say the Import Wizard is working for you? It has a checkbox that says "Generate MATLAB Code". Does this provide th...

12 years ago | 0

Answered
xlswrite cell array of strings to vertical array in Excel - goes wrong
Try just 'A2' for range, not 'A2:A11'. xlswrite(['mpSim_results_' fname(1:end-4) '.xlsx'], outputTimes(1:10), 'Sheet1','A2'...

12 years ago | 0

Answered
How to simulate a model dynamically from m-file?
The "From Workspace" block will take arrays of the form [time value] and step through the values at the time step defined. See ...

12 years ago | 0

Answered
How to simulate CAN messages without having any external device?
Install the Vector XL drivers and they should provide you with a virtual CAN channel you can use: <http://www.mathworks.com...

12 years ago | 0

| accepted

Answered
Real time simulation of a model designed for arduino without the harware board in the loop?
Make a copy of your model and replace all of the hardware specific blocks from the arduino library (input/output channels, seria...

12 years ago | 0

Answered
Random numbers with Zero mean (not the basics)
n=100; %number of random numbers you need x=randn(n/2,1); %half random numbers y=[x; -x]; %array of 'random' numbers wit...

12 years ago | 0

Answered
Conway Game of Life Help
1) neighbors(ii,jj) not neighbors 2) I prefer spy(board) to image(board) 3) You can count nonzero elements with nnz(board)...

12 years ago | 0

Answered
defining simple optimization constraint: When x1 > 0 then x2 has to equal 0
That is going to be horribly non-linear and drive the solver mad. Wouldn't it be simpler to write it as two separate proble...

12 years ago | 0

Load more