Réponse apportée
Read text file without header and separate columns
You can use the readmatrix function. A = readmatrix(filename,'NumHeaderLines',193); Edit: As Walter suggested below: releases...

environ 6 ans il y a | 1

| A accepté

Réponse apportée
using the while loop to get the number of divisions
The term you are adding never reaches that low threshold. If it would, the code below would do the trick. You can test it by set...

environ 6 ans il y a | 0

Réponse apportée
Error " Array indices must be positive integers or logical values."
You need to distinguish between the index of your variable in Matlab and the subscript in the mathematical sense. sub=___;%...

environ 6 ans il y a | 1

| A accepté

Réponse apportée
Why when using 'setappdata' in Appdesigner do I have to store it in a figure? Can I store it someplace else?
With the setappdata you are storing data somewhere in RAM, linking it to a graphics object. f=uifigure; setappdata(f,'foo','ba...

environ 6 ans il y a | 0

Réponse apportée
Root mean square error of two images
Imagen in Matlab are either 2D or 3D. Assuming your images are already 2D, the subtraction will be element-wise, after which you...

environ 6 ans il y a | 1

| A accepté

Réponse apportée
Storing error values in for loop
Don't use error as a variable name. Otherwise you can just use indexing: err=zeros(1,N); for n=1:N %your code goes here ...

environ 6 ans il y a | 0

Réponse apportée
How to build on an existing struct 4x4xn matrix?
It sounds like you can just assign that value. Matlab will expand the array and fill empty positions with 0. A.G=cat(3,[ 1 2 0 ...

environ 6 ans il y a | 0

Réponse apportée
3D Matrix find max values of each position in the first 2 dimensions
It sounds like you need this: data_2D=max(data_3D,[],3); The explanation for this syntax can be found in the documentation.

environ 6 ans il y a | 1

| A accepté

Réponse apportée
Image extraction from webpage
The HTML file doesn't contain the image. It contains a relative path to the image. Because you don't have the image file in the ...

environ 6 ans il y a | 1

| A accepté

Réponse apportée
Modifying a function (2D Plot and 3D Plot)
Use linspace separately for x and y and then use meshgrid or ndgrid. %create the vectors x=linspace(xmin,xmax,numx); y=____ ...

environ 6 ans il y a | 0

Réponse apportée
Finding repeating values in an array
You can use the outputs of the unique function to achieve this. A = [ 0.3 0.6 1 0.6 0.3]; B = [ 3 2 3 6 11]; [B1,~,ind]=uni...

environ 6 ans il y a | 0

Réponse apportée
Block GUI in Callback
This is the way I solved it in my PhotoAnnotation tool: %appdata is the guidata struct (which I now think was a poor choice as ...

environ 6 ans il y a | 0

Réponse apportée
How to change a variable in a string
It is much cleaner to use fprintf. That way you can also much more easily insert more numbers to display: function fib(n) % Se...

environ 6 ans il y a | 0

Réponse apportée
Multiple if statements with two conditions
Create an array with all implemented values of CA. Then you can use array operations to find the index, which will allow you to ...

environ 6 ans il y a | 0

| A accepté

Réponse apportée
point decimal to comma
So in summary: Matlab doesn't check the operating system's locale setting to determine the decimal separator. This question seem...

environ 6 ans il y a | 0

Réponse apportée
My function is stuck in a loop
That give_index function looks like it is very slow and may return unexpected results for non-integer inputs. It will also only ...

environ 6 ans il y a | 0

| A accepté

Réponse apportée
How to print the string value using fprintf
The error message explains what is going on: you are trying to use a cell as input to fprintf. fprintf will not 'unpack' that fo...

environ 6 ans il y a | 0

| A accepté

Réponse apportée
Is it possible for me to get the answer of certain line in a function?
Moved from comment: You can set a breakpoint on that line to pause execution, or you can add the variable as an ouput.

environ 6 ans il y a | 0

| A accepté

Réponse apportée
am trying to plot P and Q but the matrix dimensions seems to disagree with me.
Somewhere in that humongous anonymous function you have made a mistake. In this case the mistake is that you didn't use array o...

environ 6 ans il y a | 0

| A accepté

Réponse apportée
Help!! Projectile motion plot
Despite your rudeness (i.e. contiuously flagging my comments) I decided to help you. So below you will find your code with some ...

environ 6 ans il y a | 1

Réponse apportée
How do I delete a struct?
If my guesses are correct, the code below should be close to what you need. %replace this if abs(newPred.x - newPrey.x)<v && a...

environ 6 ans il y a | 0

| A accepté

Réponse apportée
Appropriate imput for dynamic structure field name
Field names in matlab adhere to the same rules as variable names. They can't start with a digit and can only contain 0-9, a-z, A...

environ 6 ans il y a | 1

| A accepté

Réponse apportée
How to create the upper diagonal block matrix in a specific form.
Here is the code that will generate blocks like [O A O;O O A] given the values of c and g. clear,clc c = 3; g = 1; syms Lamb...

environ 6 ans il y a | 0

| A accepté

Réponse apportée
THIS CODE WORKS ON 2017b BUT NOT ON 2013b "Error: If FUN is a MATLAB object, it must have an feval method." "Error: fun = fcnchk(fun);" Please Help me, I don't know that where is mistake in code?
This has been an undocumented feature since it started working. The only documented input options are a function name, something...

environ 6 ans il y a | 0

Réponse apportée
Find a row in a matrix
Assuming you have that vector already: M=[ 1 -1 1 -1 1 1 1 -1 -1 1 -1 1 % <----- this row 1 1 -1 1]; a=[-...

environ 6 ans il y a | 0

| A accepté

Réponse apportée
How to find intersection between two line
tol=2*eps; L_intersect = abs(y-y_line.Value) < tol; x(L_intersect) %you could use find(L_intersect), but you don't really nee...

environ 6 ans il y a | 0

Réponse apportée
Find Empty Fields in Matrix and Delete them
%generate fake data data=cell(30,10); for n=1:numel(data) if rand>0.2 data{n}=rand(1,5); end end %find ...

environ 6 ans il y a | 0

Réponse apportée
How to quickly index the first cell of sets of the array with near similar names?
This is bad code design. You should have made these variables fields of single struct. This has forced you to write slow buggy c...

environ 6 ans il y a | 1

Réponse apportée
Tag or label for images in montage
If you don't have the Computer Vision toolbox, you can also use my text2im function to convert text into an image.

environ 6 ans il y a | 0

Réponse apportée
while and if statements . Im trying to get my program to stop at a certain count but it only works in some parts. (beginner)
Please make sure you use Matlab syntax. The endwhile keyword is specific to Octave. If you properly allign your code it would be...

environ 6 ans il y a | 0

| A accepté

Charger plus