回答済み
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...

6年以上 前 | 1

| 採用済み

回答済み
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...

6年以上 前 | 0

回答済み
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=___;%...

6年以上 前 | 1

| 採用済み

回答済み
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...

6年以上 前 | 0

回答済み
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...

6年以上 前 | 1

| 採用済み

回答済み
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 ...

6年以上 前 | 0

回答済み
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 ...

6年以上 前 | 0

回答済み
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.

6年以上 前 | 1

| 採用済み

回答済み
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 ...

6年以上 前 | 1

| 採用済み

回答済み
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=____ ...

6年以上 前 | 0

回答済み
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...

6年以上 前 | 0

回答済み
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 ...

6年以上 前 | 0

回答済み
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...

6年以上 前 | 0

回答済み
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 ...

6年以上 前 | 0

| 採用済み

回答済み
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...

6年以上 前 | 0

回答済み
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 ...

6年以上 前 | 0

| 採用済み

回答済み
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...

6年以上 前 | 0

| 採用済み

回答済み
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.

6年以上 前 | 0

| 採用済み

回答済み
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...

6年以上 前 | 0

| 採用済み

回答済み
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 ...

6年以上 前 | 1

回答済み
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...

6年以上 前 | 0

| 採用済み

回答済み
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...

6年以上 前 | 1

| 採用済み

回答済み
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...

6年以上 前 | 0

| 採用済み

回答済み
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...

6年以上 前 | 0

回答済み
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=[-...

6年以上 前 | 0

| 採用済み

回答済み
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...

6年以上 前 | 0

回答済み
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 ...

6年以上 前 | 0

回答済み
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...

6年以上 前 | 1

回答済み
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.

6年以上 前 | 0

回答済み
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...

6年以上 前 | 0

| 採用済み

さらに読み込む