Linked Questions

111 votes
4 answers
7k views

Flatten command: matrix as second argument

One thing I could never wrap my head around is how Flatten works when provided with a matrix as the second argument, and the Mathematica help isn't particularly ...
David's user avatar
  • 14.9k
36 votes
2 answers
3k views

Transpose uneven lists

Is there a quick method to transpose uneven lists without conditionals? With: Drop[Table[q, {10}], #] & /@ Range[10] Thus the first list would have the ...
Mr. Demetrius Michael's user avatar
7 votes
4 answers
1k views

Implementation of MATLAB's "numgrid" function [closed]

I am looking for an implementation of MATLAB's numgrid function, in particular the "B" mode. For example, I want to get the matrix corresponding to the ...
Yaroslav Bulatov's user avatar
14 votes
4 answers
3k views

Reshape vectors exactly like in MATLAB

This gives a 64×1 column vector in Mathematica: ...
user1271772's user avatar
16 votes
1 answer
3k views

Any solution to transfer data between Python and Mathematica

I think Mathematica handles .mat file not very well, python is pretty good at this kind of jobs. In this site, there are plenty of question related to calling Mathematica from Python, or calling ...
Kattern's user avatar
  • 2,571
8 votes
2 answers
7k views

How do I export matrices into matlab format?

For example: ...
novice's user avatar
  • 2,325
5 votes
2 answers
828 views

'gradient' function in MMA

How to calculate Numerical gradient of 2D arrays using the "gradient function" ("Matlab-like")? "[___] = gradient(F,hx,hy,...,hN) specifies N spacing parameters for the ...
ABCDEMMM's user avatar
  • 1,856
2 votes
1 answer
4k views

Importing data from a MATLAB file to MATHEMATICA [closed]

I have been trying to import some matrices from MATLAB to MATHEMATICA. The matrices are the output after I run the MATLAB file. I had saved that file in .MAT format and trying to import it in ...
Bhavya Senwar's user avatar
3 votes
1 answer
4k views

How to import columns of data (.mat file)

I have a two 100x2 .mat file and I would like to get the elements stored as pairwise entries i.e. something like data = [{a1,b1},{a2,b2}..{a100,b100}]. Can someone help me do this efficiently?
user1936752's user avatar
7 votes
1 answer
487 views

How to implement a Kalman or LQG regulator in the control of classical pendulum problem

My final purpose is to realize an LQG control of inverted pendulum. To this end, my first step I think is to build a Kalman regulator in Mathematica. The original Matlab version of Kalman filter is ...
xinxin guo's user avatar
  • 1,401
3 votes
1 answer
960 views

Mathematica does not import .mat file correctly [closed]

I have .mat file that contains a binary (0,1) matrix with size 100*100*100. I have used this syntax to import it in mathematica ...
BetterEnglish's user avatar
1 vote
1 answer
319 views

How to find the analytical or numerical solution of a system of partial differential equations?

I am trying to use mathematica to solve a system of second-order partial differential equations, but I have been unable to solve it. The code of mathematica is as follows: ...
RuiQiang Kang's user avatar
2 votes
1 answer
242 views

Multidimensional MATLAB conversion

I try to convert this MATLAB code: From: https://github.com/gpeyre/2013-SIIMS-ot-splitting/blob/master/code/toolbox/%40staggered/interp.m https://github.com/gpeyre/2013-SIIMS-ot-splitting/blob/master/...
chkone's user avatar
  • 145
1 vote
1 answer
70 views

Create table A with entries of the form Ai_j

I would like to create an $m \times n$-table A with entries Ai_j, where $1 \leq i \leq m$ and $1 \leq j \leq n$. I have seen ...
Bipolar Minds's user avatar