Réponse apportée
How can I convert matlab code to C?
You need the toolbox Matlab Coder. in Matlab, type ver if Matlab coder is not part of the result, then you can't gene...

plus de 11 ans il y a | 0

Réponse apportée
Simulate a simulink model in matlab
You need to import your data. change the configuration parameters such as : <</matlabcentral/answers/uploaded_files/22360...

plus de 11 ans il y a | 0

Réponse apportée
How can I change pushbutton background
I'd say : for i = 1 : 8 for j = 1 : 7 btn(j,i) = uicontrol('Parent', figure_handle, ... ...

plus de 11 ans il y a | 0

| A accepté

Réponse apportée
Obtaining types of files in directory and put them into an array
you're trying to concatenate strings of different lengths, it can't work. put them in a cell array. files = dir; ...

plus de 11 ans il y a | 0

| A accepté

A résolu


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

plus de 11 ans il y a

Réponse apportée
How to do multiple saves during a loop?
I guess all your .jpg are named *image_name.jpg* ? Inside the loop, you coded : imwrite( uint8( cat(3, hot_px, hot_px, ho...

plus de 11 ans il y a | 0

| A accepté

Réponse apportée
How can I eliminate following error?
It seems you're using a 64 bits machine. You need to check if a complier is installed, thit is not provide with Matlab 64 (al...

plus de 11 ans il y a | 0

Réponse apportée
Hide image in GUI using visible on/off
Obviously, _axes1_ is not a field of your structure of handles. put a breakpoint a the line _set(handles.axes1,'visible','off...

plus de 11 ans il y a | 1

Réponse apportée
How do I add a variable date in a graphtitle?
Hi, 1) title(sprintf('Wind rose : %s',date)) 2) set(gcf,'Name','My Figure 01')

plus de 11 ans il y a | 0

| A accepté

Réponse apportée
SIMULINK Action subsystem with 1D-lookup Table, which data is not always available
Hi, First, why don't you use a look-up table block instead of a matlab function ? Second, are you sure of the values of X ...

plus de 11 ans il y a | 0

| A accepté

Réponse apportée
How to generate sine wave in Simulink by using the MATLAB function?
You could just use the sine wave block ? If you really want to use a matlab function, you need to do : <</matlabcentr...

plus de 11 ans il y a | 3

| A accepté

Réponse apportée
How can I solve an algebraic loop error?
As Simulink says it to you : just add a delay to break the algebraic loop. <</matlabcentral/answers/uploaded_files/22286/...

plus de 11 ans il y a | 10

| A accepté

Réponse apportée
Set workspace data to sub GUI by push button on main GUI
See the attached files. Run the Main gui. The pushbutton will open the subgui, load the values a and b stored in the mat f...

plus de 11 ans il y a | 1

| A accepté

Réponse apportée
Line approximation from 5 points in Matlab
Hi, <http://fr.mathworks.com/help/matlab/ref/interp1.html interp1> is your friend

plus de 11 ans il y a | 0

Réponse apportée
Set workspace data to sub GUI by push button on main GUI
Hi, you are not using the right structure of handles. the box _a_ is in the maingui. the box _b_ is in the subgui. ...

plus de 11 ans il y a | 2

Réponse apportée
fopen 'w' not writing
You forget a _fprintf(fid2,..._ line, so you are not writing anything with this code, just open and close the phone.txt file. ...

plus de 11 ans il y a | 0

| A accepté

A résolu


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

plus de 11 ans il y a

A résolu


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

plus de 11 ans il y a

A résolu


Counting Money
Add the numbers given in the cell array of strings. The strings represent amounts of money using this notation: $99,999.99. E...

plus de 11 ans il y a

A résolu


Pangrams!
A pangram, or holoalphabetic sentence, is a sentence using every letter of the alphabet at least once. Example: Input s ...

plus de 11 ans il y a

A résolu


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

plus de 11 ans il y a

A résolu


Bottles of beer
Given an input number representing the number of bottles of beer on the wall, output how many are left if you take one down and ...

plus de 11 ans il y a

A résolu


Remove all the consonants
Remove all the consonants in the given phrase. Example: Input s1 = 'Jack and Jill went up the hill'; Output s2 is 'a ...

plus de 11 ans il y a

A résolu


Too mean-spirited
Find the mean of each consecutive pair of numbers in the input row vector. For example, x=[1 2 3] ----> y = [1.5 2.5] x=[1...

plus de 11 ans il y a

A résolu


Swap the input arguments
Write a two-input, two-output function that swaps its two input arguments. For example: [q,r] = swap(5,10) returns q = ...

plus de 11 ans il y a

Réponse apportée
Bar plot with two Y-axes
Hi, try this figure a=[rand(10,1)*100 zeros(10,1) ]; b=[zeros(10,1) rand(10,1)*5 ]; [AX,H1,H2] =plotyy([1:1...

plus de 11 ans il y a | 1

| A accepté

Réponse apportée
differential Equations with ode45
Hi, you wrote : function [dy, Vy, L1 L Uk]=odefun12(t,y) N=0; Uk=0; Uk=N; => Uk = N = ...

plus de 11 ans il y a | 0

A résolu


Back to basics 6 - Column Vector
Covering some basic topics I haven't seen elsewhere on Cody. Given an input vector, output true or false whether it is a colu...

plus de 11 ans il y a

A résolu


Replace NaNs with the number that appears to its left in the row.
Replace NaNs with the number that appears to its left in the row. If there are more than one consecutive NaNs, they should all ...

plus de 11 ans il y a

Réponse apportée
Disable code generation while runnign the simulation of a model
If you want to simulate in SIL mode, SImulink will generate some code. if you don't want any code generation, you need to set...

plus de 11 ans il y a | 0

Charger plus